Update spec service to use m2a

This commit is contained in:
rijkvanzanten
2020-10-12 14:16:54 -04:00
115 changed files with 5619 additions and 2359 deletions

View File

@@ -1,20 +1,20 @@
import { Router } from 'express';
import { ServerService } from '../services';
// import { SpecificationService } from '../services';
import { SpecificationService } from '../services';
import asyncHandler from 'express-async-handler';
import { respond } from '../middleware/respond';
const router = Router();
// router.get(
// '/specs/oas',
// asyncHandler(async (req, res, next) => {
// const service = new SpecificationService({ accountability: req.accountability });
// res.locals.payload = await service.oas.generate();
// return next();
// }),
// respond
// );
router.get(
'/specs/oas',
asyncHandler(async (req, res, next) => {
const service = new SpecificationService({ accountability: req.accountability });
res.locals.payload = await service.oas.generate();
return next();
}),
respond
);
router.get('/ping', (req, res) => res.send('pong'));

View File

@@ -35,6 +35,13 @@ columns:
type: timestamp
nullable: false
default: '$now'
modified_by:
type: uuid
references:
table: directus_users
column: id
modified_on:
type: timestamp
charset:
type: string
length: 50

View File

@@ -77,7 +77,7 @@ fields:
locked: true
options:
template: '{{ name }}'
createItemText: Add Module
addLabel: Add New Module...
fields:
- name: Icon
field: icon
@@ -112,7 +112,7 @@ fields:
locked: true
options:
template: '{{ group_name }}'
createItemText: Add Group
addLabel: Add New Group...
fields:
- name: Group Name
field: group_name
@@ -123,7 +123,9 @@ fields:
options:
iconRight: title
placeholder: Label this group...
- name: Accordion
schema:
is_nullable: false
- name: Type
field: accordion
type: string
schema:
@@ -145,7 +147,7 @@ fields:
meta:
interface: repeater
options:
createItemText: Add Collection
addLabel: Add New Collection...
template: '{{ collection }}'
fields:
- name: Collection
@@ -154,6 +156,8 @@ fields:
meta:
interface: collection
width: full
schema:
is_nullable: false
special: json
sort: 10
width: full

View File

@@ -33,6 +33,7 @@ fields:
special: json
sort: 3
width: full
display: tags
- collection: directus_files
field: location
interface: text-input
@@ -91,3 +92,23 @@ fields:
- collection: directus_files
field: filesize
display: filesize
- collection: directus_files
field: modified_by
interface: user
locked: true
special: user-updated
width: half
display: user
- collection: directus_files
field: modified_on
interface: dateTime
locked: true
special: date-updated
width: half
display: datetime
- collection: directus_files
field: created_on
display: datetime
- collection: directus_files
field: created_by
display: user

View File

@@ -19,4 +19,4 @@ export * from './settings';
export * from './users';
export * from './utils';
export * from './webhooks';
// export * from './specifications'
export * from './specifications';

View File

@@ -22,7 +22,8 @@ export class RelationsService extends ItemsService {
}
async readByQuery(query: Query): Promise<null | Relation | Relation[]> {
const results = (await super.readByQuery(query)) as Relation | Relation[] | null;
const service = new ItemsService('directus_relations', { knex: this.knex });
const results = (await service.readByQuery(query)) as Relation | Relation[] | null;
const filteredResults = await this.filterForbidden(results);
return filteredResults;
}
@@ -38,10 +39,12 @@ export class RelationsService extends ItemsService {
query: Query = {},
action: PermissionsAction = 'read'
): Promise<null | Relation | Relation[]> {
const results = (await super.readByKey(key as any, query, action)) as
const service = new ItemsService('directus_relations', { knex: this.knex });
const results = (await service.readByKey(key as any, query, action)) as
| Relation
| Relation[]
| null;
const filteredResults = await this.filterForbidden(results);
return filteredResults;
}

View File

@@ -1,449 +1,583 @@
// import {
// AbstractServiceOptions,
// Accountability,
// Collection,
// Field,
// Relation,
// types,
// } from '../types';
// import { CollectionsService } from './collections';
// import { FieldsService } from './fields';
// import formatTitle from '@directus/format-title';
// import { cloneDeep, mergeWith } from 'lodash';
// import { RelationsService } from './relations';
// import env from '../env';
import {
AbstractServiceOptions,
Accountability,
Collection,
Field,
Permission,
Relation,
types,
} from '../types';
import { CollectionsService } from './collections';
import { FieldsService } from './fields';
import formatTitle from '@directus/format-title';
import { cloneDeep, mergeWith } from 'lodash';
import { RelationsService } from './relations';
import env from '../env';
import {
OpenAPIObject,
PathItemObject,
OperationObject,
TagObject,
SchemaObject,
} from 'openapi3-ts';
// // @ts-ignore
// import { version } from '../../package.json';
// @ts-ignore
import { version } from '../../package.json';
import openapi from '@directus/specs';
// // @ts-ignore
// import openapi from '@directus/specs';
import Knex from 'knex';
import database from '../database';
import { getRelationType } from '../utils/get-relation-type';
// type RelationTree = Record<string, Record<string, Relation[]>>;
export class SpecificationService {
accountability: Accountability | null;
knex: Knex;
// export class SpecificationService {
// accountability: Accountability | null;
fieldsService: FieldsService;
collectionsService: CollectionsService;
relationsService: RelationsService;
// fieldsService: FieldsService;
// collectionsService: CollectionsService;
// relationsService: RelationsService;
oas: OASService;
// oas: OASService;
constructor(options?: AbstractServiceOptions) {
this.accountability = options?.accountability || null;
this.knex = options?.knex || database;
// constructor(options?: AbstractServiceOptions) {
// this.accountability = options?.accountability || null;
this.fieldsService = new FieldsService(options);
this.collectionsService = new CollectionsService(options);
this.relationsService = new RelationsService(options);
// this.fieldsService = new FieldsService(options);
// this.collectionsService = new CollectionsService(options);
// this.relationsService = new RelationsService(options);
this.oas = new OASService(
{ knex: this.knex, accountability: this.accountability },
{
fieldsService: this.fieldsService,
collectionsService: this.collectionsService,
relationsService: this.relationsService,
}
);
}
}
// this.oas = new OASService({
// fieldsService: this.fieldsService,
// collectionsService: this.collectionsService,
// relationsService: this.relationsService,
// });
// }
// }
interface SpecificationSubService {
generate: () => Promise<any>;
}
// interface SpecificationSubService {
// generate: () => Promise<any>;
// }
class OASService implements SpecificationSubService {
accountability: Accountability | null;
knex: Knex;
// class OASService implements SpecificationSubService {
// fieldsService: FieldsService;
// collectionsService: CollectionsService;
// relationsService: RelationsService;
fieldsService: FieldsService;
collectionsService: CollectionsService;
relationsService: RelationsService;
// constructor({
// fieldsService,
// collectionsService,
// relationsService,
// }: {
// fieldsService: FieldsService;
// collectionsService: CollectionsService;
// relationsService: RelationsService;
// }) {
// this.fieldsService = fieldsService;
// this.collectionsService = collectionsService;
// this.relationsService = relationsService;
// }
constructor(
options: AbstractServiceOptions,
{
fieldsService,
collectionsService,
relationsService,
}: {
fieldsService: FieldsService;
collectionsService: CollectionsService;
relationsService: RelationsService;
}
) {
this.accountability = options.accountability || null;
this.knex = options?.knex || database;
// private collectionsDenyList = [
// 'directus_collections',
// 'directus_fields',
// 'directus_migrations',
// 'directus_sessions',
// ];
this.fieldsService = fieldsService;
this.collectionsService = collectionsService;
this.relationsService = relationsService;
}
// private fieldTypes: Record<
// typeof types[number],
// { type: string; format?: string; items?: any }
// > = {
// bigInteger: {
// type: 'integer',
// format: 'int64',
// },
// boolean: {
// type: 'boolean',
// },
// date: {
// type: 'string',
// format: 'date',
// },
// dateTime: {
// type: 'string',
// format: 'date-time',
// },
// decimal: {
// type: 'number',
// },
// float: {
// type: 'number',
// format: 'float',
// },
// integer: {
// type: 'integer',
// },
// json: {
// type: 'array',
// items: {
// type: 'string',
// },
// },
// string: {
// type: 'string',
// },
// text: {
// type: 'string',
// },
// time: {
// type: 'string',
// format: 'time',
// },
// timestamp: {
// type: 'string',
// format: 'timestamp',
// },
// binary: {
// type: 'string',
// format: 'binary',
// },
// uuid: {
// type: 'string',
// format: 'uuid',
// },
// csv: {
// type: 'array',
// items: {
// type: 'string',
// },
// },
// };
async generate() {
const collections = await this.collectionsService.readByQuery();
const fields = await this.fieldsService.readAll();
const relations = (await this.relationsService.readByQuery({})) as Relation[];
const permissions: Permission[] = await this.knex
.select('*')
.from('directus_permissions')
.where({ role: this.accountability?.role || null });
// async generate() {
// const collections = await this.collectionsService.readByQuery();
const tags = await this.generateTags(collections);
const paths = await this.generatePaths(permissions, tags);
const components = await this.generateComponents(collections, fields, relations, tags);
// const userCollections = collections.filter(
// (collection) =>
// collection.collection.startsWith('directus_') === false ||
// this.collectionsDenyList.includes(collection.collection) === false
// );
const spec: OpenAPIObject = {
openapi: '3.0.1',
info: {
title: 'Dynamic API Specification',
description:
'This is a dynamicly generated API specification for all endpoints existing on the current .',
version: version,
},
servers: [
{
url: env.PUBLIC_URL,
description: 'Your current Directus instance.',
},
],
tags,
paths,
components,
};
// const allFields = await this.fieldsService.readAll();
return spec;
}
// const fields: Record<string, Field[]> = {};
private async generateTags(collections: Collection[]): Promise<OpenAPIObject['tags']> {
const systemTags = cloneDeep(openapi.tags)!;
// for (const field of allFields) {
// if (
// field.collection.startsWith('directus_') === false ||
// this.collectionsDenyList.includes(field.collection) === false
// ) {
// if (field.collection in fields) {
// fields[field.collection].push(field);
// } else {
// fields[field.collection] = [field];
// }
// }
// }
const tags: OpenAPIObject['tags'] = [];
// const relationsResult = await this.relationsService.readByQuery({});
// if (relationsResult === null) return {};
// System tags that don't have an associated collection are always readable to the user
for (const systemTag of systemTags) {
if (!systemTag['x-collection']) {
tags.push(systemTag);
}
}
// const relations = Array.isArray(relationsResult) ? relationsResult : [relationsResult];
for (const collection of collections) {
const isSystem = collection.collection.startsWith('directus_');
// const relationsTree: RelationTree = {};
// If the collection is one of the system collections, pull the tag from the static spec
if (isSystem) {
for (const tag of openapi.tags!) {
if (tag['x-collection'] === collection.collection) {
tags.push(tag);
break;
}
}
} else {
tags.push({
name: 'Items' + formatTitle(collection.collection).replace(/ /g, ''),
description: collection.meta?.note || undefined,
'x-collection': collection.collection,
});
}
}
// for (const relation of relations as Relation[]) {
// if (relation.many_collection in relationsTree === false)
// relationsTree[relation.many_collection] = {};
// if (relation.one_collection in relationsTree === false)
// relationsTree[relation.one_collection] = {};
// Filter out the generic Items information
return tags.filter((tag) => tag.name !== 'Items');
}
// if (relation.many_field in relationsTree[relation.many_collection] === false)
// relationsTree[relation.many_collection][relation.many_field] = [];
// if (relation.one_field in relationsTree[relation.one_collection] === false)
// relationsTree[relation.one_collection][relation.one_field] = [];
private async generatePaths(
permissions: Permission[],
tags: OpenAPIObject['tags']
): Promise<OpenAPIObject['paths']> {
const paths: OpenAPIObject['paths'] = {};
// relationsTree[relation.many_collection][relation.many_field].push(relation);
// relationsTree[relation.one_collection][relation.one_field].push(relation);
// }
if (!tags) return paths;
// const dynOpenapi = {
// openapi: '3.0.1',
// info: {
// title: 'Dynamic Api Specification',
// description:
// 'This is a dynamicly generated api specification for all endpoints existing on the api.',
// version: version,
// },
// servers: [
// {
// url: env.PUBLIC_URL,
// description: 'Your current api server.',
// },
// ],
// tags: this.generateTags(userCollections),
// paths: this.generatePaths(userCollections),
// components: {
// schemas: this.generateSchemas(userCollections, fields, relationsTree),
// },
// };
for (const tag of tags) {
const isSystem =
tag.hasOwnProperty('x-collection') === false ||
tag['x-collection'].startsWith('directus_');
// return mergeWith(cloneDeep(openapi), cloneDeep(dynOpenapi), (obj, src) => {
// if (Array.isArray(obj)) return obj.concat(src);
// });
// }
if (isSystem) {
for (const [path, pathItem] of Object.entries<PathItemObject>(openapi.paths)) {
for (const [method, operation] of Object.entries<OperationObject>(pathItem)) {
if (operation.tags?.includes(tag.name)) {
if (!paths[path]) {
paths[path] = {};
}
// private getNameFormats(collection: string) {
// const isInternal = collection.startsWith('directus_');
// const schema = formatTitle(
// isInternal ? collection.replace('directus_', '').replace(/s$/, '') : collection + 'Item'
// ).replace(/ /g, '');
// const tag = formatTitle(
// isInternal ? collection.replace('directus_', '') : collection + ' Collection'
// );
// const path = isInternal ? collection : '/items/' + collection;
// const objectRef = `#/components/schemas/${schema}`;
const hasPermission =
this.accountability?.admin === true ||
tag.hasOwnProperty('x-collection') === false ||
!!permissions.find(
(permission) =>
permission.collection === tag['x-collection'] &&
permission.action === this.getActionForMethod(method)
);
// return { schema, tag, path, objectRef };
// }
if (hasPermission) {
paths[path][method] = operation;
}
}
}
}
} else {
const listBase = cloneDeep(openapi.paths['/items/{collection}']);
const detailBase = cloneDeep(openapi.paths['/items/{collection}/{id}']);
const collection = tag['x-collection'];
// private generateTags(collections: Collection[]) {
// const tags: { name: string; description?: string }[] = [];
for (const method of ['post', 'get', 'patch', 'delete']) {
const hasPermission =
this.accountability?.admin === true ||
!!permissions.find(
(permission) =>
permission.collection === collection &&
permission.action === this.getActionForMethod(method)
);
// for (const collection of collections) {
// if (collection.collection.startsWith('directus_')) continue;
// const { tag } = this.getNameFormats(collection.collection);
// tags.push({ name: tag, description: collection.meta?.note || undefined });
// }
if (hasPermission) {
if (!paths[`/items/${collection}`]) paths[`/items/${collection}`] = {};
if (!paths[`/items/${collection}/{id}`])
paths[`/items/${collection}/{id}`] = {};
// return tags;
// }
if (listBase[method]) {
paths[`/items/${collection}`][method] = mergeWith(
cloneDeep(listBase[method]),
{
description: listBase[method].description.replace(
'item',
collection + ' item'
),
tags: [tag.name],
operationId: `${this.getActionForMethod(method)}${tag.name}`,
requestBody: ['get', 'delete'].includes(method)
? undefined
: {
content: {
'application/json': {
schema: {
oneOf: [
{
type: 'array',
items: {
$ref: `#/components/schema/${tag.name}`,
},
},
{
$ref: `#/components/schema/${tag.name}`,
},
],
},
},
},
},
responses: {
'200': {
content:
method === 'delete'
? undefined
: {
'application/json': {
schema: {
properties: {
data: {
items: {
$ref: `#/components/schema/${tag.name}`,
},
},
},
},
},
},
},
},
},
(obj, src) => {
if (Array.isArray(obj)) return obj.concat(src);
}
);
}
// private generatePaths(collections: Collection[]) {
// const paths: Record<string, object> = {};
if (detailBase[method]) {
paths[`/items/${collection}/{id}`][method] = mergeWith(
cloneDeep(detailBase[method]),
{
description: detailBase[method].description.replace(
'item',
collection + ' item'
),
tags: [tag.name],
operationId: `${this.getActionForMethod(method)}Single${
tag.name
}`,
requestBody: ['get', 'delete'].includes(method)
? undefined
: {
content: {
'application/json': {
schema: {
$ref: `#/components/schema/${tag.name}`,
},
},
},
},
responses: {
'200': {
content:
method === 'delete'
? undefined
: {
'application/json': {
schema: {
properties: {
data: {
items: {
$ref: `#/components/schema/${tag.name}`,
},
},
},
},
},
},
},
},
},
(obj, src) => {
if (Array.isArray(obj)) return obj.concat(src);
}
);
}
}
}
}
}
// for (const collection of collections) {
// if (collection.collection.startsWith('directus_')) continue;
return paths;
}
// const { tag, schema, objectRef, path } = this.getNameFormats(collection.collection);
private async generateComponents(
collections: Collection[],
fields: Field[],
relations: Relation[],
tags: OpenAPIObject['tags']
): Promise<OpenAPIObject['components']> {
let components: OpenAPIObject['components'] = cloneDeep(openapi.components);
// const objectSingle = {
// content: {
// 'application/json': {
// schema: {
// $ref: objectRef,
// },
// },
// },
// };
if (!components) components = {};
// (paths[path] = {
// get: {
// operationId: `get${schema}s`,
// description: `List all items from the ${tag}`,
// tags: [tag],
// parameters: [
// { $ref: '#/components/parameters/Fields' },
// { $ref: '#/components/parameters/Limit' },
// { $ref: '#/components/parameters/Meta' },
// { $ref: '#/components/parameters/Offset' },
// { $ref: '#/components/parameters/Single' },
// { $ref: '#/components/parameters/Sort' },
// { $ref: '#/components/parameters/Filter' },
// { $ref: '#/components/parameters/q' },
// ],
// responses: {
// '200': {
// description: 'Successful request',
// content: {
// 'application/json': {
// schema: {
// type: 'object',
// properties: {
// data: {
// type: 'array',
// items: {
// $ref: objectRef,
// },
// },
// },
// },
// },
// },
// },
// '401': {
// $ref: '#/components/responses/UnauthorizedError',
// },
// },
// },
// post: {
// operationId: `create${schema}`,
// description: `Create a new item in the ${tag}`,
// tags: [tag],
// parameter: [{ $ref: '#/components/parameters/Meta' }],
// requestBody: objectSingle,
// responses: {
// '200': objectSingle,
// '401': {
// $ref: '#/components/responses/UnauthorizedError',
// },
// },
// },
// }),
// (paths[path + '/{id}'] = {
// parameters: [{ $ref: '#/components/parameters/Id' }],
// get: {
// operationId: `get${schema}`,
// description: `Get a singe item from the ${tag}`,
// tags: [tag],
// parameters: [
// { $ref: '#/components/parameters/Fields' },
// { $ref: '#/components/parameters/Meta' },
// ],
// responses: {
// '200': objectSingle,
// '401': {
// $ref: '#/components/responses/UnauthorizedError',
// },
// '404': {
// $ref: '#/components/responses/NotFoundError',
// },
// },
// },
// patch: {
// operationId: `update${schema}`,
// description: `Update an item from the ${tag}`,
// tags: [tag],
// parameters: [
// { $ref: '#/components/parameters/Fields' },
// { $ref: '#/components/parameters/Meta' },
// ],
// requestBody: objectSingle,
// responses: {
// '200': objectSingle,
// '401': {
// $ref: '#/components/responses/UnauthorizedError',
// },
// '404': {
// $ref: '#/components/responses/NotFoundError',
// },
// },
// },
// delete: {
// operationId: `delete${schema}`,
// description: `Delete an item from the ${tag}`,
// tags: [tag],
// responses: {
// '200': {
// description: 'Successful request',
// },
// '401': {
// $ref: '#/components/responses/UnauthorizedError',
// },
// '404': {
// $ref: '#/components/responses/NotFoundError',
// },
// },
// },
// });
// }
components.schemas = {};
// return paths;
// }
if (!tags) return;
// private generateSchemas(
// collections: Collection[],
// fields: Record<string, Field[]>,
// relations: RelationTree
// ) {
// const schemas: Record<string, any> = {};
for (const collection of collections) {
const tag = tags.find((tag) => tag['x-collection'] === collection.collection);
// for (const collection of collections) {
// const { schema, tag } = this.getNameFormats(collection.collection);
if (!tag) continue;
// if (fields === undefined) return;
const isSystem = collection.collection.startsWith('directus_');
// schemas[schema] = {
// type: 'object',
// 'x-tag': tag,
// properties: {},
// };
const fieldsInCollection = fields.filter(
(field) => field.collection === collection.collection
);
// for (const field of fields[collection.collection]) {
// const fieldRelations =
// field.collection in relations && field.field in relations[field.collection]
// ? relations[field.collection][field.field]
// : [];
if (isSystem) {
const schemaComponent: SchemaObject = cloneDeep(
openapi.components!.schemas![tag.name]
);
// if (fieldRelations.length !== 0) {
// const relation = fieldRelations[0];
// const isM2O =
// relation.many_collection === field.collection &&
// relation.many_field === field.field;
schemaComponent.properties = {};
// const relatedCollection = isM2O
// ? relation.one_collection
// : relation.many_collection;
// if (!relatedCollection) continue;
for (const field of fieldsInCollection) {
schemaComponent.properties[field.field] =
(cloneDeep(
(openapi.components!.schemas![tag.name] as SchemaObject).properties![
field.field
]
) as SchemaObject) || this.generateField(field, relations, tags, fields);
}
// const relatedPrimaryField = fields[relatedCollection].find(
// (field) => field.schema?.is_primary_key
// );
// if (relatedPrimaryField?.type === undefined) continue;
components.schemas[tag.name] = schemaComponent;
} else {
const schemaComponent: SchemaObject = {
type: 'object',
properties: {},
'x-collection': collection.collection,
};
// const relatedType = this.fieldTypes[relatedPrimaryField?.type];
// const { objectRef } = this.getNameFormats(relatedCollection);
for (const field of fieldsInCollection) {
schemaComponent.properties![field.field] = this.generateField(
field,
relations,
tags,
fields
);
}
// const type = isM2O
// ? {
// oneOf: [
// {
// ...relatedType,
// nullable: field.schema?.is_nullable === true,
// },
// { $ref: objectRef },
// ],
// }
// : {
// type: 'array',
// items: { $ref: objectRef },
// nullable: field.schema?.is_nullable === true,
// };
components.schemas[tag.name] = schemaComponent;
}
}
// schemas[schema].properties[field.field] = {
// ...type,
// description: field.meta?.note || undefined,
// };
// } else {
// schemas[schema].properties[field.field] = {
// ...this.fieldTypes[field.type],
// nullable: field.schema?.is_nullable === true,
// description: field.meta?.note || undefined,
// };
// }
// }
// }
// return schemas;
// }
// }
return components;
}
private getActionForMethod(method: string): 'create' | 'read' | 'update' | 'delete' {
switch (method) {
case 'post':
return 'create';
case 'patch':
return 'update';
case 'delete':
return 'delete';
case 'get':
default:
return 'read';
}
}
private generateField(
field: Field,
relations: Relation[],
tags: TagObject[],
fields: Field[]
): SchemaObject {
let propertyObject: SchemaObject = {
nullable: field.schema?.is_nullable,
description: field.meta?.note || undefined,
};
const relation = relations.find(
(relation) =>
(relation.many_collection === field.collection &&
relation.many_field === field.field) ||
(relation.one_collection === field.collection && relation.one_field === field.field)
);
if (!relation) {
propertyObject = {
...propertyObject,
...this.fieldTypes[field.type],
};
} else {
const relationType = getRelationType({
relation,
field: field.field,
collection: field.collection,
});
if (relationType === 'm2o') {
const relatedTag = tags.find(
(tag) => tag['x-collection'] === relation.one_collection
);
const relatedPrimaryKeyField = fields.find(
(field) =>
field.collection === relation.one_collection && field.schema?.is_primary_key
);
if (!relatedTag || !relatedPrimaryKeyField) return propertyObject;
propertyObject.oneOf = [
{
...this.fieldTypes[relatedPrimaryKeyField.type],
},
{
$ref: `#/components/schemas/${relatedTag.name}`,
},
];
} else if (relationType === 'o2m') {
const relatedTag = tags.find(
(tag) => tag['x-collection'] === relation.many_collection
);
const relatedPrimaryKeyField = fields.find(
(field) =>
field.collection === relation.many_collection &&
field.schema?.is_primary_key
);
if (!relatedTag || !relatedPrimaryKeyField) return propertyObject;
propertyObject.type = 'array';
propertyObject.items = {
oneOf: [
{
...this.fieldTypes[relatedPrimaryKeyField.type],
},
{
$ref: `#/components/schemas/${relatedTag.name}`,
},
],
};
} else if (relationType === 'm2a') {
const relatedTags = tags.filter((tag) =>
relation.one_allowed_collections!.includes(tag['x-collection'])
);
propertyObject.type = 'array';
propertyObject.items = {
oneOf: [
{
type: 'string',
},
relatedTags.map((tag) => ({
$ref: `#/components/schemas/${tag.name}`,
})),
],
};
}
}
return propertyObject;
}
private fieldTypes: Record<
typeof types[number],
{
type:
| 'string'
| 'number'
| 'boolean'
| 'object'
| 'array'
| 'integer'
| 'null'
| undefined;
format?: string;
items?: any;
}
> = {
bigInteger: {
type: 'integer',
format: 'int64',
},
boolean: {
type: 'boolean',
},
date: {
type: 'string',
format: 'date',
},
dateTime: {
type: 'string',
format: 'date-time',
},
decimal: {
type: 'number',
},
float: {
type: 'number',
format: 'float',
},
integer: {
type: 'integer',
},
json: {
type: 'array',
items: {
type: 'string',
},
},
string: {
type: 'string',
},
text: {
type: 'string',
},
time: {
type: 'string',
format: 'time',
},
timestamp: {
type: 'string',
format: 'timestamp',
},
binary: {
type: 'string',
format: 'binary',
},
uuid: {
type: 'string',
format: 'uuid',
},
csv: {
type: 'array',
items: {
type: 'string',
},
},
};
}

View File

@@ -1,6 +1,14 @@
<template>
<div class="v-list-group">
<v-list-item :active="active" class="activator" :to="to" :exact="exact" @click="onClick" :disabled="disabled">
<v-list-item
:active="active"
class="activator"
:to="to"
:exact="exact"
@click="onClick"
:disabled="disabled"
:dense="dense"
>
<slot name="activator" :active="groupActive" />
<v-list-item-icon class="activator-icon" :class="{ active: groupActive }" v-if="$slots.default">
@@ -15,8 +23,8 @@
</template>
<script lang="ts">
import { defineComponent, toRefs, watch } from '@vue/composition-api';
import { useGroupableParent, useGroupable } from '@/composables/groupable';
import { defineComponent, nextTick, toRefs, watch, PropType, ref } from '@vue/composition-api';
import { useGroupable } from '@/composables/groupable';
export default defineComponent({
props: {
@@ -40,10 +48,6 @@ export default defineComponent({
type: Boolean,
default: false,
},
disableGroupableParent: {
type: Boolean,
default: false,
},
scope: {
type: String,
default: undefined,
@@ -52,22 +56,19 @@ export default defineComponent({
type: [String, Number],
default: undefined,
},
dense: {
type: Boolean,
default: false,
},
},
setup(props, { listeners, emit }) {
const { multiple } = toRefs(props);
const { active: groupActive, toggle, activate, deactivate } = useGroupable({
group: props.scope,
value: props.value,
});
if (props.disableGroupableParent !== true) {
useGroupableParent(
{},
{
multiple: toRefs(props).multiple,
}
);
}
return { groupActive, toggle, onClick };
function onClick(event: MouseEvent) {

View File

@@ -25,6 +25,7 @@
<script lang="ts">
import { Location } from 'vue-router';
import { defineComponent, PropType, computed } from '@vue/composition-api';
import { useGroupable } from '@/composables/groupable';
export default defineComponent({
props: {
@@ -64,6 +65,10 @@ export default defineComponent({
type: String,
default: null,
},
value: {
type: [String, Number],
default: undefined,
},
},
setup(props, { listeners }) {
const component = computed<string>(() => {
@@ -72,6 +77,10 @@ export default defineComponent({
return 'li';
});
const { active: groupActive, toggle, activate, deactivate } = useGroupable({
value: props.value,
});
const isClickable = computed(() => Boolean(props.to || props.href || listeners.click !== undefined));
return { component, isClickable };

View File

@@ -9,7 +9,15 @@ import { defineComponent, PropType, ref, toRefs } from '@vue/composition-api';
import { useGroupableParent } from '@/composables/groupable';
export default defineComponent({
model: {
prop: 'activeItems',
event: 'input',
},
props: {
activeItems: {
type: Array as PropType<(number | string)[]>,
default: () => [],
},
large: {
type: Boolean,
default: false,
@@ -18,13 +26,23 @@ export default defineComponent({
type: Boolean,
default: true,
},
mandatory: {
type: Boolean,
default: true,
},
},
setup(props) {
setup(props, { emit }) {
const { activeItems, multiple, mandatory } = toRefs(props);
useGroupableParent(
{},
{
mandatory: ref(false),
multiple: toRefs(props).multiple,
selection: activeItems,
onSelectionChange: (newSelection) => {
emit('input', newSelection);
},
},
{
mandatory,
multiple,
}
);

View File

@@ -83,9 +83,14 @@ function mapKeys(key: string) {
function callHandlers(event: KeyboardEvent) {
Object.entries(handlers).forEach(([key, value]) => {
const rest = key.split('+').filter((keySegment) => keysdown.has(keySegment) === false);
const keys = key.split('+');
if (rest.length > 0) return;
for (key of keysdown) {
if (keys.includes(key) === false) return;
}
for (key of keys) {
if (keysdown.has(key) === false) return;
}
for (let i = 0; i < value.length; i++) {
let cancel = false;

View File

@@ -25,7 +25,7 @@ export default defineComponent({
},
placeholder: {
type: String,
default: i18n.t('empty_item'),
default: null,
},
toggle: {
type: Function,

View File

@@ -7,6 +7,7 @@
:toggle="toggle"
@delete="$emit('delete')"
:disabled="disabled"
:placeholder="headerPlaceholder"
/>
<transition-expand>
<div v-if="active">
@@ -46,6 +47,10 @@ export default defineComponent({
type: Boolean,
default: false,
},
headerPlaceholder: {
type: String,
default: null,
},
},
});
</script>

View File

@@ -10,6 +10,7 @@
@input="updateValues(index, $event)"
@delete="removeItem(row)"
:disabled="disabled"
:headerPlaceholder="headerPlaceholder"
/>
</draggable>
<button @click="addNew" class="add-new" v-if="showAddNew">
@@ -40,7 +41,7 @@ export default defineComponent({
},
template: {
type: String,
default: null
default: null,
},
addLabel: {
type: String,
@@ -54,14 +55,18 @@ export default defineComponent({
type: Boolean,
default: false,
},
headerPlaceholder: {
type: String,
default: i18n.t('empty_item'),
},
},
setup(props, { emit }) {
const selection = ref<number[]>([]);
const _template = computed(() => {
if(props.template === null) return props.fields.length > 0 ? `{{${ props.fields[0].field}}}` : ''
return props.template
})
if (props.template === null) return props.fields.length > 0 ? `{{${props.fields[0].field}}}` : '';
return props.template;
});
const showAddNew = computed(() => {
if (props.disabled) return false;

View File

@@ -424,6 +424,7 @@
"modified": "Modified",
"checksum": "Checksum",
"owner": "Owner",
"edited_by": "Edited by",
"folder": "Folder",
"set_to_now": "Set to Now",
@@ -977,6 +978,8 @@
"collection_removed": "Collection Removed",
"collection_updated": "Collection Updated",
"collections_and_fields": "Collection & Fields",
"singleton": "Singleton",
"singleton_label": "Treat as single object",
"fields": {
"directus_activity": {

View File

@@ -1,19 +1,34 @@
<template>
<v-list large>
<template v-if="customNavItems && customNavItems.length > 0">
<v-detail
:active="group.accordion === 'always_open' || undefined"
:disabled="group.accordion === 'always_open'"
:start-open="group.accordion === 'start_open'"
:label="group.name"
:key="group.name"
v-for="group in customNavItems"
>
<v-list-item :exact="exact" v-for="navItem in group.items" :key="navItem.to" :to="navItem.to">
<v-list-item-icon><v-icon :name="navItem.icon" /></v-list-item-icon>
<v-list-item-content>{{ navItem.name }}</v-list-item-content>
</v-list-item>
</v-detail>
<template v-for="(group, index) in customNavItems">
<template
v-if="
(group.name === undefined || group.name === null) &&
group.accordion === 'always_open' &&
index === 0
"
>
<v-list-item :exact="exact" v-for="navItem in group.items" :key="navItem.to" :to="navItem.to">
<v-list-item-icon><v-icon :name="navItem.icon" /></v-list-item-icon>
<v-list-item-content>{{ navItem.name }}</v-list-item-content>
</v-list-item>
</template>
<template v-else>
<v-detail
:active="group.accordion === 'always_open' || undefined"
:disabled="group.accordion === 'always_open'"
:start-open="group.accordion === 'start_open'"
:label="group.name || null"
:key="group.name"
>
<v-list-item :exact="exact" v-for="navItem in group.items" :key="navItem.to" :to="navItem.to">
<v-list-item-icon><v-icon :name="navItem.icon" /></v-list-item-icon>
<v-list-item-content>{{ navItem.name }}</v-list-item-content>
</v-list-item>
</v-detail>
</template>
</template>
</template>
<v-list-item v-else :exact="exact" v-for="navItem in navItems" :key="navItem.to" :to="navItem.to">

View File

@@ -1,21 +1,16 @@
<template>
<v-divider v-if="section.divider" />
<v-list-group v-else-if="section.children" :dense="dense">
<v-list-group v-else-if="section.children" :dense="dense" :multiple="false" :value="section.to">
<template #activator>
<v-list-item-icon v-if="section.icon !== undefined"><v-icon :name="section.icon" /></v-list-item-icon>
<v-list-item-content>
<v-list-item-text>{{ section.name }}</v-list-item-text>
</v-list-item-content>
</template>
<navigation-list-item
v-for="(childSection, index) in section.children"
:key="index"
:section="childSection"
dense
/>
<navigation-list-item v-for="(child, index) in section.children" :key="index" :section="child" dense />
</v-list-group>
<v-list-item v-else :to="`/docs${section.to}`" :dense="dense">
<v-list-item v-else :to="`/docs${section.to}`" :dense="dense" :value="section.to">
<v-list-item-icon v-if="section.icon !== undefined"><v-icon :name="section.icon" /></v-list-item-icon>
<v-list-item-content>
<v-list-item-text>{{ section.name }}</v-list-item-text>
@@ -24,7 +19,7 @@
</template>
<script lang="ts">
import { defineComponent, PropType } from '@vue/composition-api';
import { defineComponent, PropType, computed } from '@vue/composition-api';
import { Link, Group } from '@directus/docs';
export default defineComponent({

View File

@@ -1,18 +1,65 @@
<template>
<v-list large>
<v-list large :multiple="false" v-model="selection" :mandatory="false">
<navigation-item v-for="item in navSections" :key="item.name" :section="item" />
</v-list>
</template>
<script lang="ts">
import { defineComponent, PropType, computed } from '@vue/composition-api';
import { defineComponent, PropType, computed, watch, ref } from '@vue/composition-api';
import NavigationItem from './navigation-item.vue';
import { nav } from '@directus/docs';
function spreadPath(path: string) {
const sections = path.substr(1).split('/');
if (sections.length === 0) return [];
const paths: string[] = ['/' + sections[0]];
for (let i = 1; i < sections.length; i++) {
paths.push(paths[i - 1] + '/' + sections[i]);
}
return paths;
}
export default defineComponent({
components: { NavigationItem },
setup() {
return { navSections: nav.app };
props: {
path: {
type: String,
default: '/docs',
},
},
setup(props) {
const _selection = ref<string[] | null>(null);
watch(
() => props.path,
(newPath) => {
if (newPath === null) return;
_selection.value = spreadPath(newPath.replace('/docs', ''));
}
);
const selection = computed({
get() {
if (_selection.value === null && props.path !== null)
_selection.value = spreadPath(props.path.replace('/docs', ''));
return _selection.value || [];
},
set(newSelection: string[]) {
if (newSelection.length === 0) {
_selection.value = [];
} else {
if (_selection.value && _selection.value.includes(newSelection[0])) {
_selection.value = _selection.value.filter((s) => s !== newSelection[0]);
} else {
_selection.value = spreadPath(newSelection[0]);
}
}
},
});
return { navSections: nav.app, selection };
},
});
</script>

View File

@@ -31,19 +31,19 @@ export default defineModule(({ i18n }) => {
for (const doc of directory.children) {
if (doc.type === 'file') {
routes.push({
path: '/' + doc.path.replace('.md', ''),
path: '/' + doc.path.replace('.md', '').replaceAll('\\', '/'),
component: StaticDocs,
});
} else if (doc.type === 'directory') {
routes.push({
path: '/' + doc.path,
redirect: '/' + doc.children![0].path.replace('.md', ''),
});
if (doc.path && doc.children && doc.children.length > 0)
routes.push({
path: '/' + doc.path.replaceAll('\\', '/'),
redirect: '/' + doc.children![0].path.replace('.md', '').replaceAll('\\', '/'),
});
routes.push(...parseRoutes(doc));
}
}
return routes;
}
});

View File

@@ -1,7 +1,7 @@
<template>
<private-view :title="$t('page_not_found')">
<template #navigation>
<docs-navigation />
<docs-navigation :path="path" />
</template>
<div class="not-found">
@@ -13,12 +13,25 @@
</template>
<script lang="ts">
import { defineComponent } from '@vue/composition-api';
import { defineComponent, ref } from '@vue/composition-api';
import DocsNavigation from '../components/navigation.vue';
export default defineComponent({
name: 'NotFound',
components: { DocsNavigation },
async beforeRouteEnter(to, from, next) {
next((vm: any) => {
vm.path = to.path;
});
},
async beforeRouteUpdate(to, from, next) {
this.path = to.path;
next();
},
setup() {
const path = ref<string | null>(null);
return { path };
},
});
</script>

View File

@@ -9,7 +9,7 @@
</template>
<template #navigation>
<docs-navigation />
<docs-navigation :path="path" />
</template>
<div class="docs-content selectable">
@@ -55,16 +55,18 @@ export default defineComponent({
async beforeRouteEnter(to, from, next) {
const md = await getMarkdownForPath(to.path);
next((vm) => {
(vm as any).markdown = md;
next((vm: any) => {
vm.markdown = md;
vm.path = to.path;
});
},
async beforeRouteUpdate(to, from, next) {
this.markdown = await getMarkdownForPath(to.path);
this.path = to.path;
next();
},
setup() {
const path = ref<string | null>(null);
const markdown = ref('');
const view = ref<Vue>();
@@ -83,7 +85,7 @@ export default defineComponent({
view.value?.$data.contentEl?.scrollTo({ top: 0 });
});
return { markdown, title, markdownWithoutTitle, view, marked };
return { markdown, title, markdownWithoutTitle, view, marked, path };
},
});
</script>

View File

@@ -41,11 +41,25 @@
<dd>{{ file.checksum }}</dd>
</div>
<div v-if="user">
<div v-if="user_created">
<dt>{{ $t('owner') }}</dt>
<dd>
<user-popover :user="user.id">
<router-link :to="user.link">{{ user.name }}</router-link>
<user-popover :user="user_created.id">
<router-link :to="user_created.link">{{ user_created.name }}</router-link>
</user-popover>
</dd>
</div>
<div v-if="modificationDate">
<dt>{{ $t('modified') }}</dt>
<dd>{{ modificationDate }}</dd>
</div>
<div v-if="user_modified">
<dt>{{ $t('edited_by') }}</dt>
<dd>
<user-popover :user="user_modified.id">
<router-link :to="user_modified.link">{{ user_modified.name }}</router-link>
</user-popover>
</dd>
</div>
@@ -123,14 +137,15 @@ export default defineComponent({
return bytes(props.file.filesize, { decimalPlaces: 2, unitSeparator: ' ' }); // { locale: i18n.locale.split('-')[0] }
});
const { creationDate } = useCreationDate();
const { user } = useUser();
const { creationDate, modificationDate } = useDates();
const { userCreated, userModified } = useUser();
const { folder } = useFolder();
return { readableMimeType, size, creationDate, user, folder, marked };
return { readableMimeType, size, creationDate, modificationDate, userCreated, userModified, folder, marked };
function useCreationDate() {
function useDates() {
const creationDate = ref<string | null>(null);
const modificationDate = ref<string | null>(null);
watch(
() => props.file,
@@ -141,11 +156,18 @@ export default defineComponent({
new Date(props.file.uploaded_on),
String(i18n.t('date-fns_date_short'))
);
if (props.file.modified_on) {
modificationDate.value = await localizedFormat(
new Date(props.file.modified_on),
String(i18n.t('date-fns_date_short'))
);
}
},
{ immediate: true }
);
return { creationDate };
return { creationDate, modificationDate };
}
function useUser() {
@@ -156,11 +178,12 @@ export default defineComponent({
};
const loading = ref(false);
const user = ref<User | null>(null);
const userCreated = ref<User | null>(null);
const userModified = ref<User | null>(null);
watch(() => props.file, fetchUser, { immediate: true });
return { user };
return { userCreated, userModified };
async function fetchUser() {
if (!props.file) return null;
@@ -177,11 +200,27 @@ export default defineComponent({
const { id, first_name, last_name, role } = response.data.data;
user.value = {
userCreated.value = {
id: props.file.uploaded_by,
name: first_name + ' ' + last_name,
link: `/users/${id}`,
};
if (props.file.modified_by) {
const response = await api.get(`/users/${props.file.modified_by}`, {
params: {
fields: ['id', 'first_name', 'last_name', 'role'],
},
});
const { id, first_name, last_name, role } = response.data.data;
userModified.value = {
id: props.file.modified_by,
name: first_name + ' ' + last_name,
link: `/users/${id}`,
};
}
} finally {
loading.value = false;
}

View File

@@ -274,6 +274,8 @@ export default defineComponent({
'checksum',
'uploaded_by',
'uploaded_on',
'modified_by',
'modified_on',
'duration',
'folder',
'charset',
@@ -287,9 +289,9 @@ export default defineComponent({
});
const to = computed(() => {
if(item.value && item.value?.folder) return `/files?folder=${item.value.folder}`
else return '/files'
})
if (item.value && item.value?.folder) return `/files?folder=${item.value.folder}`;
else return '/files';
});
const { formFields } = useFormFields(fieldsFiltered);
@@ -332,7 +334,7 @@ export default defineComponent({
selectedFolder,
fileSrc,
form,
to
to,
};
function changeCacheBuster() {

View File

@@ -178,6 +178,7 @@ export default defineComponent({
interface: 'one-to-many',
},
});
state.relations[0].one_field = state.relations[0].one_collection;
} else {
state.newFields = state.newFields.filter((field: any) => field.$type !== 'corresponding');
}

View File

@@ -26,19 +26,25 @@
<v-tabs-items v-model="currentTab">
<v-tab-item value="collection">
<h2 class="type-title">{{ $t('creating_collection_info') }}</h2>
<div class="type-label">
{{ $t('name') }}
<v-icon class="required" v-tooltip="$t('required')" name="star" sup />
</div>
<v-input
autofocus
class="monospace"
v-model="collectionName"
db-safe
:placeholder="$t('a_unique_table_name')"
/>
<v-divider />
<div class="grid">
<div>
<div class="type-label">
{{ $t('name') }}
<v-icon class="required" v-tooltip="$t('required')" name="star" sup />
</div>
<v-input
autofocus
class="monospace"
v-model="collectionName"
db-safe
:placeholder="$t('a_unique_table_name')"
/>
</div>
<div>
<div class="type-label">{{ $t('singleton') }}</div>
<v-checkbox block :label="$t('singleton_label')" v-model="singleton" />
</div>
<v-divider class="full" />
<div>
<div class="type-label">{{ $t('primary_key_field') }}</div>
<v-input
@@ -73,9 +79,14 @@
<v-tab-item value="system">
<h2 class="type-title">{{ $t('creating_collection_system') }}</h2>
<div class="grid system">
<div class="field" v-for="(info, field) in systemFields" :key="field">
<div v-for="(info, field) in systemFields" :key="field">
<div class="type-label">{{ $t(info.label) }}</div>
<v-input v-model="info.name" class="monospace" :class="{active: info.enabled}" @click.native="info.enabled = true">
<v-input
v-model="info.name"
class="monospace"
:class="{ active: info.enabled }"
@click.native="info.enabled = true"
>
<template #prepend>
<v-checkbox v-model="info.enabled" />
</template>
@@ -124,6 +135,7 @@ export default defineComponent({
const currentTab = ref(['collection']);
const collectionName = ref(null);
const singleton = ref(false);
const primaryKeyFieldName = ref('id');
const primaryKeyFieldType = ref<'auto_int' | 'uuid' | 'manual'>('auto_int');
@@ -184,6 +196,7 @@ export default defineComponent({
collectionName,
saveError,
saving,
singleton,
};
async function save() {
@@ -198,6 +211,7 @@ export default defineComponent({
archive_field: archiveField.value,
archive_value: archiveValue.value,
unarchive_value: unarchiveValue.value,
singleton: singleton.value,
},
});
@@ -412,22 +426,14 @@ export default defineComponent({
</script>
<style lang="scss" scoped>
@import '@/styles/mixins/form-grid';
.type-title {
margin-bottom: 48px;
}
.type-label {
margin-bottom: 12px;
}
.v-divider {
margin: 48px 0;
}
.grid {
display: grid;
grid-gap: 48px 36px;
grid-template-columns: repeat(2, 1fr);
@include form-grid;
}
.system {

View File

@@ -7,17 +7,21 @@ const dirTree = require('directory-tree');
const yaml = require('js-yaml');
async function build() {
console.log('Building docs...');
const start = Date.now();
const distPath = path.resolve(__dirname, './dist');
await rimraf(distPath);
const tree = dirTree('.', { extensions: /\.md/, exclude: /dist/ });
const tree = dirTree('.', { extensions: /\.md/, exclude: /(dist|node_modules)/ });
await fse.ensureDir(distPath);
await fse.writeJSON('./dist/index.json', tree);
await copyfiles(['./**/*.md', distPath]);
await copyfiles(['./**/*.md', distPath], { exclude: './node_modules/**/*.*' });
const yamlFiles = [];
const filesInRoot = await fse.readdir(__dirname);
@@ -35,6 +39,8 @@ async function build() {
yaml.safeLoad(yamlString)
);
}
console.log(`Built docs in ${Date.now() - start} ms`);
}
build();

1
docs/index.d.ts vendored
View File

@@ -21,6 +21,7 @@ export type Link = {
export type Group = {
name: string;
to: string;
children: (Group | Link | Divider)[];
icon?: string;
};

View File

@@ -1,5 +1,6 @@
- name: Getting Started
icon: play_arrow
to: "/getting-started"
children:
- name: Introduction
to: "/getting-started/introduction"
@@ -12,6 +13,7 @@
- name: Concepts
icon: school
to: "/concepts"
children:
- name: Platform Overview
to: "/concepts/platform-overview"
@@ -32,6 +34,7 @@
- name: Guides
icon: article
to: "/guides"
children:
- name: Collections
to: "/guides/collections"
@@ -73,6 +76,7 @@
- name: Reference
icon: code
to: "/reference"
children:
- name: Command Line Interface
to: "/reference/command-line-interface"

1079
docs/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -6,7 +6,17 @@
"main": "index.js",
"scripts": {
"build": "node build.js",
"prepublish": "npm run build"
"prepublish": "npm run build",
"dev": "npm-watch build"
},
"watch": {
"build": {
"patterns": ["."],
"ignore": "dist",
"extensions": "md,yaml",
"silent": true,
"quiet": true
}
},
"files": [
"dist"
@@ -14,5 +24,8 @@
"keywords": [],
"author": "",
"license": "ISC",
"gitHead": "4476da28dbbc2824e680137aa28b2b91b5afabec"
"gitHead": "4476da28dbbc2824e680137aa28b2b91b5afabec",
"devDependencies": {
"npm-watch": "^0.7.0"
}
}

5
packages/spec/index.d.ts vendored Normal file
View File

@@ -0,0 +1,5 @@
import { OpenAPIObject } from 'openapi3-ts';
declare const DirectusSpec: OpenAPIObject;
export default DirectusSpec;

File diff suppressed because it is too large Load Diff

View File

@@ -1,14 +1,23 @@
{
"name": "@directus/specs",
"version": "9.0.0-beta.10",
"description": "Specification of the Directus Api",
"description": "OpenAPI Specification of the Directus API",
"main": "index.js",
"scripts": {
"ui:watch": "swagger-ui-watcher specs/openapi.yaml",
"validate": "swagger-cli validate specs/openapi.yaml",
"build": "swagger-cli bundle specs/openapi.yaml -o dist/openapi.json",
"build:deref": "swagger-cli bundle specs/openapi.yaml -o dist/openapi-deref.json --dereference",
"prepublishOnly": "npm run build && npm run build:deref"
"prepublishOnly": "npm run build && npm run build:deref",
"dev": "npm-watch build"
},
"watch": {
"build": {
"patterns": ["specs"],
"extensions": "yaml",
"quiet": true,
"silent": true
}
},
"repository": {
"type": "git",
@@ -26,5 +35,9 @@
"README.md",
"index.js"
],
"gitHead": "4476da28dbbc2824e680137aa28b2b91b5afabec"
"gitHead": "4476da28dbbc2824e680137aa28b2b91b5afabec",
"devDependencies": {
"npm-watch": "^0.7.0",
"swagger-cli": "^4.0.4"
}
}

View File

@@ -1,4 +1,5 @@
type: object
x-collection: directus_activity
properties:
id:
description: Unique identifier for the object.
@@ -8,39 +9,44 @@ properties:
description: Action that was performed.
example: update
type: string
enum: [authenticate, comment, upload, create, update, delete, soft-delete, revert, invalid-credentials]
enum:
- create
- update
- delete
- authenticate
user:
description: Unique identifier of the user account who caused this action.
example: 63716273-0f29-4648-8a2a-2af2948f6f78
type: string
nullable: true # States the SQL structure
description: The user who performed this action.
oneOf:
- type: string
- $ref: "../openapi.yaml#/components/schemas/Users"
nullable: true
timestamp:
description: When the action happened.
example: '2019-12-05 22:52:09'
example: "2019-12-05T22:52:09Z"
type: string
format: date-time
ip:
description: The IP address of the user at the time the action took place.
example: 160.72.72.58
example: 127.0.0.1
oneOf:
- type: string
format: ipv4
- type: string
enum: [localhost]
user_agent:
description: User agent string of the browser the user used when the action took place.
example: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_1) AppleWebKit/537.36 (KHTML,like Gecko) Chrome/78.0.3904.108 Safari/537.36
type: string
collection:
description: Collection identifier in which the item resides.
example: movies
type: string
oneOf:
- type: string
- $ref: "../openapi.yaml#/components/schemas/Collections"
item:
description: Unique identifier for the item the action applied to. This is always a string, even for integer primary keys.
example: '328'
example: "328"
type: string
comment:
description: User comment. This will store the comments that show up in the right
description:
User comment. This will store the comments that show up in the right
sidebar of the item edit page in the admin app.
example: null
type: string

View File

@@ -1,43 +1,86 @@
type: object
x-collection: directus_collections
properties:
collection:
description: The collection name.
description: The collection key.
example: customers
type: string
meta:
description: Metadata of the collection.
type: object
example: null
nullable: true
properties:
collection:
description: The collection name again!
description: The collection key.
example: customers
type: string
hidden:
type: boolean
singleton:
type: boolean
icon:
description: Name of a Google Material Design Icon that's assigned to this collection.
type: string
example: people
nullable: true
note:
description: A note describing the collection.
type: string
nullable: true
translation:
type: string
example: null
nullable: true
display_template:
description: Text representation of how items from this collection are shown across the system.
type: string
example: null
nullable: true
hidden:
description: Whether or not the collection is hidden from the navigation in the admin app.
type: boolean
example: false
singleton:
description: Whether or not the collection is treated as a single object.
type: boolean
example: false
translations:
description: Key value pairs of how to show this collection's name in different languages in the admin app.
type: string
example: null
nullable: true
archive_field:
description: What field holds the archive value.
type: string
example: null
nullable: true
archive_app_filter:
description: What value to use for "archived" items.
type: string
example: null
nullable: true
archive_value:
description: What value to use to "unarchive" items.
type: string
example: null
nullable: true
unarchive_value:
description: Whether or not to show the "archived" filter.
type: string
example: null
nullable: true
sort_field:
description: The sort field in the collection.
type: string
example: null
nullable: true
schema:
type: object
properties:
name:
description: The collection key.
type: string
example: customers
schema:
description: Database schema (pg only).
example: public
type: string
comment:
description: Comment as saved in the database.
type: string
collation:
type: string
engine:
type: string
example: null
nullable: true

View File

@@ -1,10 +1,6 @@
type: object
x-collection: directus_fields
properties:
id:
description: Unique identifier for the field in the `directus_fields` collection.
example: 167
type: integer
nullable: true
collection:
description: Unique name of the collection this field is in.
example: about_us
@@ -13,102 +9,159 @@ properties:
description: Unique name of the field. Field name is unique within the collection.
example: id
type: string
auto_increment:
description: If the value in this field is auto incremented. Only applies to integer
type fields.
example: true
type: boolean
datatype:
description: SQL datatype of the column that corresponds to this field.
example: INT
type: string
nullable: true
group:
description: What field group this field is part of.
example: null
type: integer
nullable: true
hidden_browse:
description: If this field should be hidden from the item browse (listing) page.
example: true
type: boolean
hidden_detail:
description: If this field should be hidden from the item detail (edit) page.
example: true
type: boolean
interface:
description: What interface is used in the admin app to edit the value for this
field.
example: primary-key
type: string
nullable: true
length:
description: Length of the field. Will be used in SQL to set the `length` property
of the colummn.
example: '10'
type: string
nullable: true
locked:
description: If the field can be altered by the end user. Directus system fields
have this value set to `true`.
example: true
type: boolean
note:
description: A user provided note for the field. Will be rendered alongside the
interface on the edit page.
example: ''
type: string
nullable: true
options:
description: Options for the interface that's used. This format is based on the
individual interface.
example: null
type: object
nullable: true
primary_key:
description: If this field is the primary key of the collection.
example: true
type: boolean
readonly:
description: Prevents the user from editing the value in the field.
example: false
type: boolean
required:
description: If this field requires a value.
example: true
type: boolean
signed:
description: If the value is signed or not. Only applies to integer type fields.
example: false
type: boolean
sort:
description: Sort order of this field on the edit page of the admin app.
example: 1
type: integer
nullable: true
translation:
description: 'Key value pair of `<locale>: <translation>` that allows the user
to change the displayed name of the field in the admin app.'
example: null
type: object
nullable: true
type:
description: Directus specific data type. Used to cast values in the API.
example: integer
type: string
unique:
description: If the value of this field should be unique within the collection.
example: false
type: boolean
validation:
description: User provided regex that will be used in the API to validate incoming
values. It uses the PHP flavor of RegEX.
example: null
type: string
schema:
description: The schema info.
type: object
properties:
name:
description: The name of the field.
example: title
type: string
table:
description: The collection of the field.
example: posts
type: string
type:
description: The datatype of the field.
example: string
type: string
default_value:
description: The default value of the field.
example: null
type: string
nullable: true
max_length:
description: The max length of the field.
example: null
type: integer
nullable: true
is_nullable:
description: If the field is nullable.
example: false
type: boolean
is_primary_key:
description: If the field is primary key.
example: false
type: boolean
has_auto_increment:
description: If the field has auto increment.
example: false
type: boolean
foreign_key_column:
description: Related column from the foreign key constraint.
example: null
type: string
nullable: true
foreign_key_table:
description: Related table from the foreign key constraint.
example: null
type: string
nullable: true
comment:
description: Comment as saved in the database.
example: null
type: string
nullable: true
schema:
description: Database schema (pg only).
example: public
type: string
foreign_key_schema:
description: Related schema from the foreign key constraint (pg only).
example: null
type: string
nullable: true
meta:
description: The meta info.
type: object
nullable: true
width:
description: Width of the field on the edit form.
example: null
type: string
nullable: true
enum: [half, half-left, half-right, full, fill, null]
properties:
id:
description: Unique identifier for the field in the `directus_fields` collection.
example: 3
type: integer
collection:
description: Unique name of the collection this field is in.
example: posts
type: string
field:
description: Unique name of the field. Field name is unique within the collection.
example: title
type: string
special:
description: Transformation flags for field
example: null
type: array
items:
type: string
nullable: true
interface:
description:
What interface is used in the admin app to edit the value for this field.
example: primary-key
type: string
nullable: true
options:
description:
Options for the interface that's used. This format is based on the individual interface.
example: null
type: object
nullable: true
display:
description: What display is used in the admin app to display the value for this field.
example: null
type: string
nullable: true
display_options:
description: Options for the display that's used. This format is based on the individual display.
example: null
type: object
nullable: true
locked:
description:
If the field can be altered by the end user. Most Directus system fields
have this value set to `true`.
example: true
type: boolean
readonly:
description: Prevents the user from editing the value in the field.
example: false
type: boolean
hidden:
description: If this field should be hidden.
example: true
type: boolean
sort:
description: Sort order of this field on the edit page of the admin app.
example: 1
type: integer
nullable: true
width:
description: Width of the field on the edit form.
example: null
type: string
nullable: true
enum: [half, half-left, half-right, full, fill, null]
group:
description: What field group this field is part of.
example: null
type: integer
nullable: true
translations:
description:
"Key value pair of `<locale>: <translation>` that allows the user
to change the displayed name of the field in the admin app."
example: null
type: object
nullable: true
note:
description:
A user provided note for the field. Will be rendered alongside the
interface on the edit page.
example: ""
type: string
nullable: true

View File

@@ -1,60 +1,72 @@
type: object
x-collection: directus_files
properties:
id:
description: Unique identifier for the file.
example: 8cbb43fe-4cdf-4991-8352-c461779cec02
type: string
storage:
description:
Where the file is stored. Either `local` for the local filesystem
or the name of the storage adapter (for example `s3`).
example: local
type: string
filename_disk:
description:
Name of the file on disk. By default, Directus uses a random hash
for the filename.
example: a88c3b72-ac58-5436-a4ec-b2858531333a.jpg
type: string
filename_download:
description: How you want to the file to be named when it's being downloaded.
example: avatar.jpg
type: string
title:
description:
Title for the file. Is extracted from the filename on upload, but
can be edited by the user.
example: User Avatar
type: string
type:
description: MIME type of the file.
example: image/jpeg
type: string
folder:
description: Virtual folder where this file resides in.
example: null
oneOf:
- type: string
- $ref: "../openapi.yaml#/components/schemas/Folders"
nullable: true
uploaded_by:
description: Who uploaded the file.
example: 63716273-0f29-4648-8a2a-2af2948f6f78
oneOf:
- type: string
- $ref: "../openapi.yaml#/components/schemas/Users"
uploaded_on:
description: When the file was uploaded.
example: "2019-12-03T00:10:15+00:00"
type: string
format: date-time
charset:
description: Character set of the file.
example: binary
type: string
nullable: true # Should not be null?
checksum:
description: Represents the sum of the correct digits of the file, can be used
to detect errors in and duplicates of the file later.
example: d41d8cd98f00b204e9800998ecf8427e
type: string
data:
example:
embed: null
full_url: 'https://demo.directus.io/uploads/thumper/originals/a88c3b72-ac58-5436-a4ec-b2858531333a.jpg'
thumbnails:
dimension: 64x64
height: 64
relative_url: '/thumper/assets/pnw7s9lqy68048g0?key=directus-small-crop'
url: 'https://demo.directus.io/thumper/assets/pnw7s9lqy68048g0?key=directus-small-crop'
width: 64
url: '/uploads/thumper/originals/a88c3b72-ac58-5436-a4ec-b2858531333a.jpg'
properties:
full_url:
description: Full URL to the original file.
type: string
thumbnails:
description: List of all available asset sizes with links.
type: array
nullable: true
items:
type: object
properties:
dimension:
description: Width x height of the thumbnail.
type: string
height:
description: Height of the thumbnail in pixels.
type: integer
relative_url:
description: Relative URL to the thumbnail.
type: string
url:
description: Full URL to the thumbnail.
type: string
width:
description: Width of the thumbnail in pixels.
type: integer
url:
description: Relative URL to the original file.
type: string
type: object
description:
description: Description for the file.
example: ''
type: string
nullable: true
filesize:
description: Size of the file in bytes.
example: 137862
type: integer
width:
description: Width of the file in pixels. Only applies to images.
example: 800
type: integer
nullable: true
height:
description: Height of the file in pixels. Only applies to images.
example: 838
type: integer
nullable: true
duration:
description: Duration of the file in seconds. Only applies to audio and video.
@@ -66,82 +78,25 @@ properties:
example: null
type: string
nullable: true
filename_disk:
description: Name of the file on disk. By default, Directus uses a random hash
for the filename.
example: a88c3b72-ac58-5436-a4ec-b2858531333a.jpg
description:
description: Description for the file.
type: string
filename_download:
description: How you want to the file to be named when it's being downloaded.
example: avatar.jpg
type: string
filesize:
description: Size of the file in bytes.
example: 137862
type: integer
folder:
description: Virtual folder where this file resides in.
example: null
$ref: '../openapi.yaml#/components/schemas/Folder'
nullable: true
height:
description: Height of the file in pixels. Only applies to images.
example: 838
type: integer
nullable: true
id:
description: Unique identifier for the file.
example: 8cbb43fe-4cdf-4991-8352-c461779cec02
type: string
location:
description: Where the file was created. Is automatically populated based on EXIF
description:
Where the file was created. Is automatically populated based on EXIF
data for images.
type: string
nullable: true
metadata:
description: User provided miscellaneous key value pairs that serve as additional
metadata for the file.
example: null
type: object
nullable: true
private_hash:
description: Random hash used to access the file privately. This can be rotated
to prevent unauthorized access to the file.
example: pnw7s9lqy68048g0
type: string
storage:
description: Where the file is stored. Either `local` for the local filesystem
or the name of the storage adapter (for example `s3`).
example: local
type: string
tags:
description: Tags for the file. Is automatically populated based on EXIF data
for images.
description:
Tags for the file. Is automatically populated based on EXIF data for images.
type: array
nullable: true
items:
type: string
title:
description: Title for the file. Is extracted from the filename on upload, but
can be edited by the user.
example: User Avatar
type: string
type:
description: MIME type of the file.
example: image/jpeg
type: string
uploaded_by:
description: Who uploaded the file.
example: 63716273-0f29-4648-8a2a-2af2948f6f78
type: string
# $ref: '../openapi.yaml#/components/schemas/User'
uploaded_on:
description: When the file was uploaded.
example: '2019-12-03T00:10:15+00:00'
type: string
format: date-time
width:
description: Width of the file in pixels. Only applies to images.
example: 800
type: integer
nullable: true
metadata:
description:
IPTC, EXIF, and ICC metadata extracted from file
type: object
nullable: true

View File

@@ -1,4 +1,5 @@
type: object
x-collection: directus_files
properties:
id:
description: Unique identifier for the folder.
@@ -11,5 +12,7 @@ properties:
parent:
description: Unique identifier of the parent folder. This allows for nested folders.
example: null
type: string
oneOf:
- type: string
- $ref: "../openapi.yaml#/components/schemas/Folders"
nullable: true

View File

@@ -1,2 +1,2 @@
type: object
properties: {}
properties: {}

View File

@@ -1,70 +1,47 @@
type: object
x-collection: directus_permissions
properties:
collection:
description: What collection this permission applies to.
example: customers
type: string
comment:
description: If the user can post comments.
example: update
type: string
enum: [none, create, update, full]
create:
description: If the user can create items.
example: full
type: string
enum: [none, full]
delete:
description: If the user can update items.
example: none
type: string
enum: [none, mine, role, full]
explain:
description: If the user is required to leave a comment explaining what was changed.
example: none
type: string
enum: [none, create, update, always]
id:
description: Unique identifier for the permission.
example: 1
type: integer
read:
description: If the user can read items.
example: mine
type: string
enum: [none, mine, role, full]
read_field_blacklist:
description: Explicitly denies read access for specific fields.
example: []
type: array
items:
type: string
role:
description: Unique identifier of the role this permission applies to.
example: 2f24211d-d928-469a-aea3-3c8f53d4e426
type: string
nullable: true # Should this be nullable?
status:
description: What status this permission applies to.
example: null
type: string
nullable: true
status_blacklist:
description: Explicitly denies specific statuses to be used.
example: []
oneOf:
- type: array
nullable: true
items:
type: string
update:
description: If the user can update items.
example: none
collection:
description: What collection this permission applies to.
example: customers
type: string
enum: [none, mine, role, full]
write_field_blacklist:
description: Explicitly denies write access for specific fields.
example: []
action:
description: What action this permission applies to.
example: create
type: string
enum:
- create
- read
- update
- delete
permissions:
description: JSON structure containing the permissions checks for this permission.
type: object
nullable: true
validation:
description: JSON structure containing the validation checks for this permission.
type: object
nullable: true
presets:
description: JSON structure containing the preset value for created/updated items.
type: object
nullable: true
fields:
description: CSV of fields that the user is allowed to interact with.
type: array
items:
type: string
type: string
nullable: true
limit:
description: Maximum amount of items the user can interact with at a time.
type: number
nullable: true

View File

@@ -1,73 +1,73 @@
type: object
x-collection: directus_presets
properties:
id:
description: Unique identifier for this single collection preset.
example: 155
type: integer
bookmark:
description:
Name for the bookmark. If this is set, the preset will be considered a bookmark.
nullable: true
type: string
user:
description:
The unique identifier of the user to whom this collection preset applies.
example: 63716273-0f29-4648-8a2a-2af2948f6f78
nullable: true
oneOf:
- type: string
- $ref: "../openapi.yaml#/components/schemas/Users"
role:
description:
The unique identifier of a role in the platform. If `user` is null,
this will be used to apply the collection preset or bookmark for all users in
the role.
example: 50419801-0f30-8644-2b3c-9bc2d980d0a0
nullable: true
oneOf:
- type: string
- $ref: "../openapi.yaml#/components/schemas/Roles"
collection:
description: What collection this collection preset is used for.
example: articles
oneOf:
- type: string
- $ref: "../openapi.yaml#/components/schemas/Collections"
search:
description: Search query.
type: string
nullable: true
filters:
description: The filters that the user applied.
example:
field: title
operator: contains
value: Hello
- key: 7RwVrquB5dPmfbrI1rcWy
field: title
operator: contains
value: Hello
type: array
nullable: true
items:
type: object
id:
description: Unique identifier for this single collection preset.
example: '155'
type: integer
role:
description: The unique identifier of a role in the platform. If `user` is null,
this will be used to apply the collection preset or bookmark for all users in
the role.
example: 63716273-0f29-4648-8a2a-2af2948f6f78
nullable: true
layout:
description: Key of the layout that is used.
type: string
search_query:
description: What the user searched for in search/filter in the header bar.
example: null
type: string
nullable: true
title:
description: Name for the bookmark. If this is set, the collection preset will
be considered to be a bookmark.
example: null
type: string
nullable: true
translation:
description: Key value pair of language-translation. Can be used to translate
the bookmark title in multiple languages.
example: null
type: object
nullable: true
user:
description: The unique identifier of the user to whom this collection preset
applies.
example: 63716273-0f29-4648-8a2a-2af2948f6f78
nullable: true
type: string
view_options:
description: Options of the views. The properties in here are controlled by the
layout.
example:
timeline:
color: action
content: excerpt
date: published_on
title: '{{ title }} ({{ author.first_name }} {{ author.last_name }})'
type: object
nullable: true
view_query:
description: View query that's saved per view type. Controls what data is fetched
layout_query:
description:
Layout query that's saved per layout type. Controls what data is fetched
on load. These follow the same format as the JS SDK parameters.
example:
timeline:
cards:
sort: -published_on
type: object
nullable: true
view_type:
description: Name of the view type that is used.
example: timeline
type: string
layout_options:
description:
Options of the views. The properties in here are controlled by the layout.
example:
cards:
icon: account_circle
title: "{{ first_name }} {{ last_name }}"
subtitle: "{{ title }}"
size: 3
nullable: true

View File

@@ -1,5 +1,10 @@
type: object
x-collection: directus_relations
properties:
id:
description: Unique identifier for the relation.
example: 1
type: integer
many_collection:
description: Collection that has the field that holds the foreign key.
example: directus_activity
@@ -9,7 +14,7 @@ properties:
example: user
type: string
many_primary:
description: The primary field.
description: The primary key field of the current collection.
example: id
type: string
one_collection:
@@ -22,16 +27,12 @@ properties:
type: string
nullable: true
one_primary:
description: The primary field.
description: The primary key field of the related collection.
example: id
type: string
id:
description: Unique identifier for the relation.
example: 1
type: integer
junction_field:
description: Field on the junction table that holds the primary key of the related
collection.
description:
Field on the junction table that holds the many field of the related relation.
example: null
type: string
nullable: true

View File

@@ -1,12 +1,25 @@
type: object
x-collection: directus_revisions
properties:
activity:
description: Unique identifier for the [activity](/api/activity) record.
example: 2
id:
description: Unique identifier for the revision.
example: 1
type: integer
activity:
description: Unique identifier for the activity record.
example: 2
oneOf:
- type: integer
- $ref: "../openapi.yaml#/components/schemas/Activity"
collection:
description: Collection of the updated item.
example: articles
oneOf:
- type: string
- $ref: "../openapi.yaml#/components/schemas/Collections"
item:
description: Primary key of updated item.
example: "168"
type: string
data:
description: Copy of item state at time of update.
@@ -14,38 +27,18 @@ properties:
author: 1
body: This is my first post
featured_image: 15
id: '168'
id: "168"
title: Hello, World!
type: object
nullable: true # Should this be nullable?
nullable: true
delta:
description: Changes between the previous and the current revision.
example:
title: Hello, World!
oneOf:
- type: object
id:
description: Unique identifier for the revision.
example: 1
type: object
parent:
description:
If the current item was updated relationally, this is the id of the parent revision record
example: null
type: integer
item:
description: Primary key of updated item.
example: '168'
type: string
parent_changed:
description: If the current item was updated relationally, this shows if the parent
item was updated as well.
example: false
type: boolean
parent_collection:
description: If the current item was updated relationally, this is the collection
of the parent item.
example: null
type: string
nullable: true
parent_item:
description: If the current item was updated relationally, this is the unique
identifier of the parent item.
example: null
type: string
nullable: true

View File

@@ -1,43 +1,52 @@
type: object
x-collection: directus_roles
properties:
collection_listing:
description: Custom override for the admin app collection navigation.
example: null
type: object
nullable: true
id:
description: Unique identifier for the role.
example: 2f24211d-d928-469a-aea3-3c8f53d4e426
type: string
name:
description: Name of the role.
example: Administrator
type: string
icon:
description: The role's icon.
example: verified_user
type: string
description:
description: Description of the role.
example: Admins have access to all managed data within the system by default
type: string
nullable: true
enforce_tfa:
description: Whether or not this role enforces the use of 2FA.
example: false
type: boolean
external_id:
description: ID used with external services in SCIM.
example: null
type: string
nullable: true
id:
description: Unique identifier for the role.
example: 2f24211d-d928-469a-aea3-3c8f53d4e426
type: string
ip_whitelist:
description: Array of IP addresses that are allowed to connect to the API as a
ip_access:
description:
Array of IP addresses that are allowed to connect to the API as a
user of this role.
example: []
type: array
items:
type: string
module_listing:
enforce_tfa:
description: Whether or not this role enforces the use of 2FA.
example: false
type: boolean
module_list:
description: Custom override for the admin app module bar navigation.
example: null
type: array
items:
type: object
nullable: true
name:
description: Name of the role.
example: Administrator
type: string
collection_list:
description: Custom override for the admin app collection navigation.
example: null
type: object
nullable: true
admin_access:
description: Admin role. If true, skips all permission checks.
example: false
type: boolean
app_access:
description: The users in the role are allowed to use the app.
example: true
type: boolean

View File

@@ -1,7 +1,84 @@
type: object
x-collection: directus_settings
properties:
id:
description: Unique identifier for the setting.
example: 1
type: integer
additionalProperties: true
example: 1
project_name:
description: The name of the project.
type: string
example: Directus
project_url:
description: The url of the project.
type: string
example: null
nullable: true
project_color:
description: The brand color of the project.
type: string
example: null
nullable: true
project_logo:
description: The logo of the project.
type: string
example: null
nullable: true
public_foreground:
description: The foreground of the project.
type: string
example: null
nullable: true
public_background:
description: The background of the project.
type: string
example: null
nullable: true
public_note:
description: Note rendered on the public pages of the app.
type: string
example: null
nullable: true
auth_login_attempts:
description: Allowed authentication login attempts before the user's status is set to blocked.
type: integer
example: 25
auth_password_policy:
description: Authentication password policy.
type: string
nullable: true
storage_asset_transform:
description: What transformations are allowed in the assets endpoint.
type: string
enum:
- all
- none
- presets
example: "all"
nullable: true
storage_asset_presets:
description: Array of allowed
type: array
items:
type: object
properties:
key:
description: Key for the asset. Used in the assets endpoint.
type: string
fit:
description: Whether to crop the thumbnail to match the size, or maintain the aspect ratio.
type: string
enum:
- cover
- contain
width:
description: Width of the thumbnail.
type: integer
height:
description: Height of the thumbnail.
type: integer
quality:
description: Quality of the compression used.
type: integer
example: null
nullable: true

View File

@@ -1,76 +1,92 @@
type: object
x-collection: directus_users
properties:
tfa_secret:
description: The 2FA secret string that's used to generate one time passwords.
example: null
id:
description: Unique identifier for the user.
example: 63716273-0f29-4648-8a2a-2af2948f6f78
type: string
first_name:
description: First name of the user.
example: Admin
type: string
last_name:
description: Last name of the user.
example: User
type: string
nullable: true
avatar:
description: The user's avatar.
example: null
oneOf:
- type: integer
nullable: true
- type: string
- $ref: '../openapi.yaml#/components/schemas/File'
nullable: true
email:
description: Unique email address for the user.
example: admin@example.com
type: string
format: email
external_id:
description: ID used for SCIM.
password:
description: Password of the user.
type: string
location:
description: The user's location.
example: null
type: string
nullable: true
first_name:
description: First name of the user.
example: Admin
type: string
id:
description: Unique identifier for the user.
example: 63716273-0f29-4648-8a2a-2af2948f6f78
type: string
last_login:
description: When this user logged in last.
example: '2020-05-31 14:32:37'
title:
description: The user's title.
example: null
type: string
nullable: true
format: date-time
last_name:
description: First name of the user.
example: User
type: string
last_page:
description: Last page that the user was on.
example: /my-project/settings/collections/a
description:
description: The user's description.
example: null
type: string
nullable: true
tags:
description: The user's tags.
example: null
type: array
nullable: true
items:
type: string
avatar:
description: The user's avatar.
example: null
oneOf:
- type: string
- $ref: "../openapi.yaml#/components/schemas/Files"
nullable: true
language:
description: The user's language used in Directus.
example: en-US
type: string
role:
description: Unique identifier of the role of this user.
example: 2f24211d-d928-469a-aea3-3c8f53d4e426
type: string
status:
description: Status of the user.
example: active
type: string
enum: [active, invited, draft, suspended, deleted]
theme:
description: What theme the user is using.
example: auto
type: string
enum: [light, dark, auto]
timezone:
description: The user's timezone.
example: America/New_York
type: string
title:
description: The user's title.
tfa_secret:
description: The 2FA secret string that's used to generate one time passwords.
example: null
type: string
nullable: true
nullable: true
status:
description: Status of the user.
example: active
type: string
enum: [active, invited, draft, suspended, deleted]
role:
description: Unique identifier of the role of this user.
example: 2f24211d-d928-469a-aea3-3c8f53d4e426
oneOf:
- type: string
- $ref: "../openapi.yaml#/components/schemas/Roles"
token:
description: Static token for the user.
type: string
nullable: true
last_acces:
description: When this user used the API last.
example: "2020-05-31T14:32:37Z"
type: string
nullable: true
format: date-time
last_page:
description: Last page that the user was on.
example: /my-project/settings/collections/a
type: string
nullable: true

View File

@@ -1,6 +1,42 @@
type: object
x-collection: directus_webhooks
properties:
id:
description: The index of the webhook.
type: integer
example: 1
example: 1
name:
description: The name of the webhook.
type: string
example: create articles
method:
description: Method used in the webhook.
type: string
example: POST
url:
description: The url of the webhook.
type: string
example: null
nullable: true
status:
description: The status of the webhook.
type: string
example: inactive
data:
description: If yes, send the content of what was done
type: boolean
example: true
actions:
description: The actions that triggers this webhook.
type: array
items:
type: string
example: null
nullable: true
collections:
description: The collections that triggers this webhook.
type: array
items:
type: string
example: null
nullable: true

View File

@@ -1,303 +1,297 @@
openapi: 3.0.1
info:
title: Directus SDK
title: Directus API
description: Template for generating any kind of SDK.
contact:
email: contact@directus.io
license:
name: GPL-3.0
url: 'https://www.gnu.org/licenses/gpl-3.0.de.html'
version: 1.0.0
url: "https://www.gnu.org/licenses/gpl-3.0.html"
version: 9.0.0
externalDocs:
description: Directus Docs
url: 'https://docs.directus.io'
servers:
- url: 'https://demo.directus.io/'
- url: '/'
url: "https://docs.directus.io"
tags:
- name: Activity
description: All events that happen within Directus are tracked and stored in the activities collection. This gives you full accountability over everything that happens.
x-collection: directus_activity
- name: Assets
description: Image typed files can be dynamically resized and transformed to fit any need.
- name: Authentication
description: All events that happen within Directus are tracked and stored in the activities collection. This gives you full accountability over everything that happens.
- name: Collection presets
description: Collection presets hold the preferences of individual users of the platform. This allows Directus to show and maintain custom item listings for users of the app.
- name: Presets
description: Presets hold the preferences of individual users of the platform. This allows Directus to show and maintain custom item listings for users of the app.
x-collection: directus_presets
- name: Collections
description: Collections are the individual collections of items, similar to tables in a database. Changes to collections will alter the schema of the database.
x-collection: directus_collections
- name: Extensions
description: Directus can easily be extended through the addition of several types of extensions, including layouts, interfaces, and modules.
- name: Fields
description: Fields are individual pieces of content within an item. They are mapped to columns in the database.
x-collection: directus_fields
- name: Files
description: Files can be saved in any given location. Directus has a powerful assets endpoint that can be used to generate thumbnails for images on the fly.
x-collection: directus_files
- name: Folders
description: Folders don't do anything yet, but will be used in the (near) future to be able to group files.
description: Group files by virtual folders.
x-collection: directus_folders
- name: Items
description: Items are individual pieces of data in your database. They can be anything, from articles, to IoT status checks.
- name: Mail
description: Send electronic mail through the electronic post.
- name: Permissions
description: Permissions control who has access to what and when.
- name: Projects
description: Projects are the individual tenants of the platform. Each project has its own database and data.
x-collection: directus_permissions
- name: Relations
description: What data is linked to what other data. Allows you to assign authors to articles, products to sales, and whatever other structures you can think of.
x-collection: directus_relations
- name: Revisions
description: Revisions are individual changes to items made. Directus keeps track of changes made, so you're able to revert to a previous state at will.
x-collection: directus_revisions
- name: Roles
description: Roles are groups of users that share permissions.
- name: SCIM
description: Directus partially supports Version 2 of System for Cross-domain Identity Management (SCIM). It is an open standard that allows for the exchange of user information between systems, therefore allowing users to be externally managed using the endpoints described below.
x-collection: directus_roles
- name: Server
description: Access to where Directus runs. Allows you to make sure your server has everything needed to run the platform, and check what kind of latency we're dealing with.
- name: Settings
description: Settings control the way the platform works and acts.
x-collection: directus_settings
- name: Users
description: Users are what gives you access to the data.
x-collection: directus_users
- name: Utilities
description: Directus comes with various utility endpoints you can use to simplify your development flow.
- name: Webhooks
description: Webhooks.
x-collection: directus_webhooks
paths:
# Activity
/activity:
$ref: './paths/activity/activitys.yaml'
$ref: "./paths/activity/activities.yaml"
/activity/comment:
$ref: './paths/activity/activity-comments.yaml'
$ref: "./paths/activity/activity-comments.yaml"
/activity/{id}:
$ref: './paths/activity/activity.yaml'
$ref: "./paths/activity/activity.yaml"
/activity/comment/{id}:
$ref: './paths/activity/activity-comment.yaml'
$ref: "./paths/activity/activity-comment.yaml"
# Assets
/assets/{key}:
$ref: './paths/assets/assets.yaml'
/assets/{id}:
$ref: "./paths/assets/assets.yaml"
# Authentication
/auth/login:
$ref: './paths/auth/login.yaml'
$ref: "./paths/auth/login.yaml"
/auth/refresh:
$ref: './paths/auth/refresh.yaml'
$ref: "./paths/auth/refresh.yaml"
/auth/logout:
$ref: './paths/auth/logout.yaml'
$ref: "./paths/auth/logout.yaml"
/auth/password/request:
$ref: './paths/auth/password-request.yaml'
$ref: "./paths/auth/password-request.yaml"
/auth/password/reset:
$ref: './paths/auth/password-reset.yaml'
$ref: "./paths/auth/password-reset.yaml"
/auth/sso:
$ref: './paths/auth/sso.yaml'
$ref: "./paths/auth/sso.yaml"
/auth/sso/{provider}:
$ref: './paths/auth/sso-provider.yaml'
$ref: "./paths/auth/sso-provider.yaml"
# Items
/items/{collection}:
$ref: './paths/items/items.yaml'
$ref: "./paths/items/items.yaml"
/items/{collection}/{id}:
$ref: './paths/items/item.yaml'
$ref: "./paths/items/item.yaml"
# Presets
/presets:
$ref: './paths/presets/presets.yaml'
$ref: "./paths/presets/presets.yaml"
/presets/{id}:
$ref: './paths/presets/preset.yaml'
$ref: "./paths/presets/preset.yaml"
# Collections
/collections:
$ref: './paths/collections/collections.yaml'
/collections/{collection}:
$ref: './paths/collections/collection.yaml'
$ref: "./paths/collections/collections.yaml"
/collections/{id}:
$ref: "./paths/collections/collection.yaml"
# Extensions
/interfaces:
$ref: './paths/extensions/interfaces.yaml'
/layouts:
$ref: './paths/extensions/layouts.yaml'
/modules:
$ref: './paths/extensions/modules.yaml'
/extensions/interfaces:
$ref: "./paths/extensions/interfaces.yaml"
/extensions/layouts:
$ref: "./paths/extensions/layouts.yaml"
/extensions/displays:
$ref: "./paths/extensions/displays.yaml"
/extensions/modules:
$ref: "./paths/extensions/modules.yaml"
# Fields
/fields:
$ref: './paths/fields/fields.yaml'
$ref: "./paths/fields/fields.yaml"
/fields/{collection}:
$ref: './paths/fields/collection-fields.yaml'
/fields/{collection}/{field}:
$ref: './paths/fields/collection-field.yaml'
$ref: "./paths/fields/collection-fields.yaml"
/fields/{collection}/{id}:
$ref: "./paths/fields/collection-field.yaml"
# Files
/files:
$ref: './paths/files/files.yaml'
$ref: "./paths/files/files.yaml"
/files/{id}:
$ref: './paths/files/file.yaml'
$ref: "./paths/files/file.yaml"
/files/{id}/revisions:
$ref: './paths/files/revisions.yaml'
$ref: "./paths/files/revisions.yaml"
/files/{id}/revisions/{offset}:
$ref: './paths/files/revision.yaml'
$ref: "./paths/files/revision.yaml"
# Folders
/folders:
$ref: './paths/folders/folders.yaml'
$ref: "./paths/folders/folders.yaml"
/folders/{id}:
$ref: './paths/folders/folder.yaml'
# Mail
/mail:
$ref: './paths/mail/mail.yaml'
$ref: "./paths/folders/folder.yaml"
# Permissions
/permissions:
$ref: './paths/permissions/permissions.yaml'
$ref: "./paths/permissions/permissions.yaml"
/permissions/me:
$ref: './paths/permissions/permissions-me.yaml'
$ref: "./paths/permissions/permissions-me.yaml"
/permissions/{id}:
$ref: './paths/permissions/permission.yaml'
/permissions/me/{collection}:
$ref: './paths/permissions/permissions-me-collection.yaml'
$ref: "./paths/permissions/permission.yaml"
# Relations
/relations:
$ref: './paths/relations/relations.yaml'
$ref: "./paths/relations/relations.yaml"
/relations/{id}:
$ref: './paths/relations/relation.yaml'
$ref: "./paths/relations/relation.yaml"
# Revisions
/revisions:
$ref: './paths/revisions/revisions.yaml'
$ref: "./paths/revisions/revisions.yaml"
/revisions/{id}:
$ref: './paths/revisions/revision.yaml'
$ref: "./paths/revisions/revision.yaml"
# Revisions
# Roles
/roles:
$ref: './paths/roles/roles.yaml'
$ref: "./paths/roles/roles.yaml"
/roles/{id}:
$ref: './paths/roles/role.yaml'
$ref: "./paths/roles/role.yaml"
# SCIM
/scim/v2/Users:
$ref: './paths/scim/users.yaml'
/scim/v2/Users/{id}:
$ref: './paths/scim/user.yaml'
/scim/v2/Groups:
$ref: './paths/scim/groups.yaml'
/scim/v2/Groups/{id}:
$ref: './paths/scim/group.yaml'
# Server
/server/info:
$ref: './paths/server/info.yaml'
servers:
- url: 'https://demo.directus.io/'
$ref: "./paths/server/info.yaml"
/server/ping:
$ref: './paths/server/ping.yaml'
servers:
- url: 'https://demo.directus.io/'
$ref: "./paths/server/ping.yaml"
# Settings
/settings:
$ref: './paths/settings/settings.yaml'
$ref: "./paths/settings/settings.yaml"
# Users
/users:
$ref: './paths/users/users.yaml'
/users/me:
$ref: './paths/users/me.yaml'
/users/invite:
$ref: './paths/users/user-invite.yaml'
$ref: "./paths/users/users.yaml"
/users/{id}:
$ref: './paths/users/user.yaml'
/users/invite/{token}:
$ref: './paths/users/user-invite-token.yaml'
$ref: "./paths/users/user.yaml"
/users/{id}/track/page:
$ref: './paths/users/user-tracking.yaml'
$ref: "./paths/users/user-tracking.yaml"
/users/invite:
$ref: "./paths/users/user-invite.yaml"
/users/invite/accept:
$ref: "./paths/users/user-invite-accept.yaml"
/users/me:
$ref: "./paths/users/me.yaml"
/users/me/track/page:
$ref: "./paths/users/me-tracking.yaml"
/users/me/tfa/enable:
$ref: "./paths/users/me-tfa-enable.yaml"
/users/me/tfa/disable:
$ref: "./paths/users/me-tfa-disable.yaml"
# Utilities
/utils/hash:
$ref: './paths/utils/hash.yaml'
$ref: "./paths/utils/hash.yaml"
/utils/hash/verify:
$ref: './paths/utils/hash-match.yaml'
$ref: "./paths/utils/hash-match.yaml"
/utils/random/string:
$ref: './paths/utils/random.yaml'
$ref: "./paths/utils/random.yaml"
/utils/sort/{collection}:
$ref: "./paths/utils/sort.yaml"
# Webhooks
/webhooks:
$ref: './paths/webhooks/webhooks.yaml'
$ref: "./paths/webhooks/webhooks.yaml"
/webhooks/{id}:
$ref: "./paths/webhooks/webhook.yaml"
components:
schemas:
Activity:
$ref: './components/activity.yaml'
Preset:
$ref: './components/preset.yaml'
Collection:
$ref: './components/collection.yaml'
Field:
$ref: './components/field.yaml'
File:
$ref: './components/file.yaml'
Folder:
$ref: './components/folder.yaml'
Item:
$ref: './components/item.yaml'
Permissions:
$ref: './components/permissions.yaml'
Relation:
$ref: './components/relation.yaml'
Revision:
$ref: './components/revision.yaml'
Role:
$ref: './components/role.yaml'
Setting:
$ref: './components/setting.yaml'
User:
$ref: './components/user.yaml'
Webhook:
$ref: './components/webhook.yaml'
parameters:
# All path parameters
Id:
$ref: './parameters/id.yaml'
UUId:
$ref: './parameters/uuid.yaml'
Collection:
$ref: './parameters/collection.yaml'
# All query parameters
q:
$ref: './parameters/q.yaml'
Page:
$ref: './parameters/page.yaml'
Offset:
$ref: './parameters/offset.yaml'
Single:
$ref: './parameters/single.yaml'
Sort:
$ref: './parameters/sort.yaml'
Meta:
$ref: './parameters/meta.yaml'
Limit:
$ref: './parameters/limit.yaml'
Filter:
$ref: './parameters/filter.yaml'
$ref: "./components/activity.yaml"
Presets:
$ref: "./components/preset.yaml"
Collections:
$ref: "./components/collection.yaml"
Fields:
$ref: './parameters/fields.yaml'
$ref: "./components/field.yaml"
Files:
$ref: "./components/file.yaml"
Folders:
$ref: "./components/folder.yaml"
Items:
$ref: "./components/item.yaml"
Permissions:
$ref: "./components/permissions.yaml"
Relations:
$ref: "./components/relation.yaml"
Revisions:
$ref: "./components/revision.yaml"
Roles:
$ref: "./components/role.yaml"
Settings:
$ref: "./components/setting.yaml"
Users:
$ref: "./components/user.yaml"
Webhooks:
$ref: "./components/webhook.yaml"
parameters:
# All path parameters
Id:
$ref: "./parameters/id.yaml"
UUId:
$ref: "./parameters/uuid.yaml"
Collection:
$ref: "./parameters/collection.yaml"
# All query parameters
Search:
$ref: "./parameters/search.yaml"
Page:
$ref: "./parameters/page.yaml"
Offset:
$ref: "./parameters/offset.yaml"
Single:
$ref: "./parameters/single.yaml"
Sort:
$ref: "./parameters/sort.yaml"
Meta:
$ref: "./parameters/meta.yaml"
Limit:
$ref: "./parameters/limit.yaml"
Filter:
$ref: "./parameters/filter.yaml"
Fields:
$ref: "./parameters/fields.yaml"
Mode:
$ref: './parameters/mode.yaml'
$ref: "./parameters/mode.yaml"
responses:
NotFoundError:
$ref: './responses/notFoundError.yaml'
$ref: "./responses/notFoundError.yaml"
UnauthorizedError:
$ref: './responses/unauthorizedError.yaml'
$ref: "./responses/unauthorizedError.yaml"
securitySchemes:
KeyAuth:
type: apiKey
in: query
name: access_token
description: Use the key 'admin' to authenticate to the public api.
Auth:
type: apiKey
in: header
name: 'Authorization'
description: To authenticate, use the "/auth/authenticate" endpoint with the credentials "admin@example.com" | "password". Use the api key here like so "Bearer \<key\>".
security:
name: "Authorization"
security:
- Auth: []
- KeyAuth: []

View File

@@ -1,6 +1,6 @@
description: Collection of which you want to retrieve the permissions.
description: Collection of which you want to retrieve the items from.
name: collection
in: path
required: true
schema:
type: string
type: string

View File

@@ -6,4 +6,4 @@ schema:
type: array
items:
type: string
pattern: '^(\[[^\[\]]*?\]){1}(\[(=|eq|<>|!=|neq|<|lt|<=|lte|>|gt|>=|gte|in|nin|null|nnull|contains|like|ncontains|nlike|rlike|nrlike|between|nbetween|empty|nempty|all|has)\])?=.*?$'
pattern: '^(\[[^\[\]]*?\]){1}(\[(_eq|_neq|_lt|_lte|_gt|_gte|_in|_nin|_null|_nnull|_contains|_ncontains|_between|_nbetween|_empty|_nempty)\])?=.*?$'

View File

@@ -1,6 +1,6 @@
description: Index of the file.
description: Index
name: id
in: path
required: true
schema:
type: integer
type: integer

View File

@@ -3,4 +3,4 @@ in: query
name: page
required: false
schema:
type: integer
type: integer

View File

@@ -1,6 +1,6 @@
description: Filter by items that contain the given search query in one of their fields.
in: query
name: q
name: search
required: false
schema:
type: string
type: string

View File

@@ -0,0 +1,30 @@
get:
operationId: getActivities
description: Returns a list of activity actions.
parameters:
- $ref: "../../openapi.yaml#/components/parameters/Fields"
- $ref: "../../openapi.yaml#/components/parameters/Limit"
- $ref: "../../openapi.yaml#/components/parameters/Meta"
- $ref: "../../openapi.yaml#/components/parameters/Offset"
- $ref: "../../openapi.yaml#/components/parameters/Single"
- $ref: "../../openapi.yaml#/components/parameters/Sort"
- $ref: "../../openapi.yaml#/components/parameters/Filter"
- $ref: "../../openapi.yaml#/components/parameters/Search"
responses:
"200":
content:
application/json:
schema:
type: object
properties:
data:
type: array
items:
$ref: "../../openapi.yaml#/components/schemas/Activity"
description: Successful request
"401":
$ref: "../../openapi.yaml#/components/responses/UnauthorizedError"
"404":
$ref: "../../openapi.yaml#/components/responses/NotFoundError"
tags:
- Activity

View File

@@ -2,7 +2,8 @@ patch:
description: Update the content of an existing comment.
operationId: updateComment
parameters:
- $ref: '../../openapi.yaml#/components/parameters/Meta'
- $ref: "../../openapi.yaml#/components/parameters/Id"
- $ref: "../../openapi.yaml#/components/parameters/Meta"
requestBody:
content:
application/json:
@@ -13,32 +14,32 @@ patch:
type: string
example: My updated comment
responses:
'200':
"200":
content:
application/json:
schema:
type: object
properties:
data:
$ref: '../../openapi.yaml#/components/schemas/Activity'
$ref: "../../openapi.yaml#/components/schemas/Activity"
description: Successful request
'401':
$ref: '../../openapi.yaml#/components/responses/UnauthorizedError'
'404':
$ref: '../../openapi.yaml#/components/responses/NotFoundError'
"401":
$ref: "../../openapi.yaml#/components/responses/UnauthorizedError"
"404":
$ref: "../../openapi.yaml#/components/responses/NotFoundError"
tags:
- Activity
- Activity
delete:
description: Delete an existing comment. Deleted comments can not be retrieved.
operationId: deleteComment
parameters:
- $ref: "../../openapi.yaml#/components/parameters/Id"
responses:
'203':
"203":
description: Deleted succsessfully
'401':
$ref: '../../openapi.yaml#/components/responses/UnauthorizedError'
'404':
$ref: '../../openapi.yaml#/components/responses/NotFoundError'
"401":
$ref: "../../openapi.yaml#/components/responses/UnauthorizedError"
"404":
$ref: "../../openapi.yaml#/components/responses/NotFoundError"
tags:
- Activity
parameters:
- $ref: '../../openapi.yaml#/components/parameters/Id'
- Activity

View File

@@ -2,13 +2,13 @@ post:
description: Creates a new comment.
operationId: createComment
parameters:
- $ref: '../../openapi.yaml#/components/parameters/Meta'
- $ref: "../../openapi.yaml#/components/parameters/Meta"
requestBody:
content:
application/json:
schema:
type: object
required: [ "collection", "item", "comment" ]
required: ["collection", "item", "comment"]
properties:
collection:
type: string
@@ -20,18 +20,18 @@ post:
type: string
example: A new comment
responses:
'200':
"200":
content:
application/json:
schema:
type: object
properties:
data:
$ref: '../../openapi.yaml#/components/schemas/Activity'
$ref: "../../openapi.yaml#/components/schemas/Activity"
description: Successful request
'401':
$ref: '../../openapi.yaml#/components/responses/UnauthorizedError'
'404':
$ref: '../../openapi.yaml#/components/responses/NotFoundError'
"401":
$ref: "../../openapi.yaml#/components/responses/UnauthorizedError"
"404":
$ref: "../../openapi.yaml#/components/responses/NotFoundError"
tags:
- Activity
- Activity

View File

@@ -1,13 +1,14 @@
get:
description: Retrieves the details of an existing activity action. Provide the primary
description:
Retrieves the details of an existing activity action. Provide the primary
key of the activity action and Directus will return the corresponding information.
operationId: getActivity
parameters:
- $ref: '../../openapi.yaml#/components/parameters/Id'
- $ref: '../../openapi.yaml#/components/parameters/Fields'
- $ref: '../../openapi.yaml#/components/parameters/Meta'
- $ref: "../../openapi.yaml#/components/parameters/Id"
- $ref: "../../openapi.yaml#/components/parameters/Fields"
- $ref: "../../openapi.yaml#/components/parameters/Meta"
responses:
'200':
"200":
description: Successful request
content:
application/json:
@@ -15,10 +16,10 @@ get:
type: object
properties:
data:
$ref: '../../openapi.yaml#/components/schemas/Activity'
'401':
$ref: '../../openapi.yaml#/components/responses/UnauthorizedError'
'404':
$ref: '../../openapi.yaml#/components/responses/NotFoundError'
$ref: "../../openapi.yaml#/components/schemas/Activity"
"401":
$ref: "../../openapi.yaml#/components/responses/UnauthorizedError"
"404":
$ref: "../../openapi.yaml#/components/responses/NotFoundError"
tags:
- Activity
- Activity

View File

@@ -1,30 +0,0 @@
get:
operationId: getActivitys
description: Returns a list of activity actions.
parameters:
- $ref: '../../openapi.yaml#/components/parameters/Fields'
- $ref: '../../openapi.yaml#/components/parameters/Limit'
- $ref: '../../openapi.yaml#/components/parameters/Meta'
- $ref: '../../openapi.yaml#/components/parameters/Offset'
- $ref: '../../openapi.yaml#/components/parameters/Single'
- $ref: '../../openapi.yaml#/components/parameters/Sort'
- $ref: '../../openapi.yaml#/components/parameters/Filter'
- $ref: '../../openapi.yaml#/components/parameters/q'
responses:
'200':
content:
application/json:
schema:
type: object
properties:
data:
type: array
items:
$ref: '../../openapi.yaml#/components/schemas/Activity'
description: Successful request
'401':
$ref: '../../openapi.yaml#/components/responses/UnauthorizedError'
'404':
$ref: '../../openapi.yaml#/components/responses/NotFoundError'
tags:
- Activity

View File

@@ -3,12 +3,12 @@ get:
- Assets
operationId: getAsset
description: Image typed files can be dynamically resized and transformed to fit any need.
security:
security:
- Auth: []
parameters:
- name: key
- name: id
in: path
description: private_hash of the file
description: The id of the file.
required: true
schema:
type: string
@@ -41,11 +41,11 @@ get:
minimum: 1
maximum: 100
responses:
'200':
"200":
description: Successful request
content:
text/plain:
schema:
type: string
'404':
$ref: '../../openapi.yaml#/components/responses/NotFoundError'
"404":
$ref: "../../openapi.yaml#/components/responses/NotFoundError"

View File

@@ -8,7 +8,7 @@ post:
application/json:
schema:
type: object
required: [ email, password ]
required: [email, password]
properties:
email:
type: string
@@ -21,26 +21,29 @@ post:
example: password
mode:
type: string
enum: [jwt, cookie]
default: jwt
enum: ["json", cookie]
default: "json"
description: Choose between retrieving the token as a string, or setting it as a cookie.
otp:
type: string
description: If 2FA is enabled, you need to pass the one time password.
responses:
'200':
"200":
description: Successful authentification
content:
application/json:
schema:
type: object
properties:
public:
type: boolean
data:
type: object
properties:
token:
access_token:
type: string
user:
$ref: '../../openapi.yaml#/components/schemas/User'
example: eyJhbGciOiJI...
expires:
type: integer
example: 900
refresh_token:
type: string
example: yuOJkjdPXMd...

View File

@@ -3,6 +3,17 @@ post:
tags:
- Authentication
operationId: logout
requestBody:
content:
application/json:
schema:
type: object
required: [token]
properties:
refresh_token:
type: string
example: eyJ0eXAiOiJKV...
description: JWT access token you want to logout.
responses:
'200':
description: Request successful
"200":
description: Request successful

View File

@@ -8,16 +8,12 @@ post:
application/json:
schema:
type: object
required: [ email ]
required: [email]
properties:
email:
type: string
example: admin@example.com
description: Email address of the user you're requesting a reset for.
reset_url:
type: string
example: https://mydomain.com/passwordreset
description: Provide a custom reset url which the link in the Email will lead to. The reset token will be passed as a parameter.
responses:
'401':
$ref: '../../openapi.yaml#/components/responses/UnauthorizedError'
"401":
$ref: "../../openapi.yaml#/components/responses/UnauthorizedError"

View File

@@ -8,7 +8,7 @@ post:
application/json:
schema:
type: object
required: [ token, password ]
required: [token, password]
properties:
token:
type: string
@@ -20,5 +20,5 @@ post:
format: password
description: New password for the user.
responses:
'401':
$ref: '../../openapi.yaml#/components/responses/UnauthorizedError'
"401":
$ref: "../../openapi.yaml#/components/responses/UnauthorizedError"

View File

@@ -8,26 +8,31 @@ post:
application/json:
schema:
type: object
required: [ token ]
required: [token]
properties:
refresh_token:
type: string
example: eyJ0eXAiOiJKV...
description: JWT access token you want to refresh. This token can't be expired.
responses:
'200':
"200":
description: Successful request
content:
application/json:
schema:
type: object
properties:
public:
type: boolean
data:
type: object
properties:
token:
access_token:
type: string
'401':
$ref: '../../openapi.yaml#/components/responses/UnauthorizedError'
example: eyJhbGciOiJI...
expires:
type: integer
example: 900
refresh_token:
type: string
example: Gy-caJMpmGTA...
"401":
$ref: "../../openapi.yaml#/components/responses/UnauthorizedError"

View File

@@ -10,7 +10,7 @@ get:
required: true
schema:
type: string
- $ref: '../../openapi.yaml#/components/parameters/Mode'
- $ref: "../../openapi.yaml#/components/parameters/Mode"
- name: redirect_url
in: query
required: true
@@ -18,7 +18,7 @@ get:
schema:
type: string
responses:
'200':
"200":
description: Successful request
content:
application/json:
@@ -32,5 +32,5 @@ get:
properties:
token:
type: string
'401':
$ref: '../../openapi.yaml#/components/responses/UnauthorizedError'
"401":
$ref: "../../openapi.yaml#/components/responses/UnauthorizedError"

View File

@@ -4,7 +4,7 @@ get:
operationId: sso
description: List the SSO providers.
responses:
'200':
"200":
description: Successful request
content:
application/json:
@@ -18,5 +18,5 @@ get:
example: ["github", "facebook"]
items:
type: string
'401':
$ref: '../../openapi.yaml#/components/responses/UnauthorizedError'
"401":
$ref: "../../openapi.yaml#/components/responses/UnauthorizedError"

View File

@@ -2,84 +2,123 @@ get:
description: Retrieves the details of a single collection.
operationId: getCollection
parameters:
- $ref: '../../openapi.yaml#/components/parameters/Meta'
- $ref: "../../openapi.yaml#/components/parameters/Meta"
responses:
'200':
"200":
content:
application/json:
schema:
type: object
properties:
data:
$ref: '../../openapi.yaml#/components/schemas/Collection'
$ref: "../../openapi.yaml#/components/schemas/Collections"
description: Successful request
'401':
$ref: '../../openapi.yaml#/components/responses/UnauthorizedError'
'404':
$ref: '../../openapi.yaml#/components/responses/NotFoundError'
"401":
$ref: "../../openapi.yaml#/components/responses/UnauthorizedError"
"404":
$ref: "../../openapi.yaml#/components/responses/NotFoundError"
tags:
- Collections
- Collections
patch:
description: Update an existing collection.
operationId: updateCollection
parameters:
- $ref: '../../openapi.yaml#/components/parameters/Meta'
- $ref: "../../openapi.yaml#/components/parameters/Meta"
requestBody:
content:
application/json:
schema:
type: object
properties:
note:
type: string
description: A note describing the collection.
hidden:
type: boolean
description: Whether or not the collection is hidden from the navigation in the admin app.
single:
type: string
description: Whether or not the collection is treated as a single record.
managed:
type: string
description: If Directus is tracking and managing this collection currently.
icon:
type: string
description: Name of a Google Material Design Icon that's assigned to this collection.
translation:
meta:
description: Metadata of the collection.
type: object
description: Key value pairs of how to show this collection's name in different languages in the admin app.
properties:
icon:
description: Name of a Google Material Design Icon that's assigned to this collection.
type: string
example: people
nullable: true
note:
description: A note describing the collection.
type: string
example: null
nullable: true
display_template:
description: Text representation of how items from this collection are shown across the system.
type: string
example: null
nullable: true
hidden:
description: Whether or not the collection is hidden from the navigation in the admin app.
type: boolean
example: false
singleton:
description: Whether or not the collection is treated as a single object.
type: boolean
example: false
translation:
description: Key value pairs of how to show this collection's name in different languages in the admin app.
type: string
example: null
nullable: true
archive_field:
description: What field holds the archive value.
type: string
example: null
nullable: true
archive_app_filter:
description: What value to use for "archived" items.
type: string
example: null
nullable: true
archive_value:
description: What value to use to "unarchive" items.
type: string
example: null
nullable: true
unarchive_value:
description: Whether or not to show the "archived" filter.
type: string
example: null
nullable: true
sort_field:
description: The sort field in the collection.
type: string
example: null
nullable: true
responses:
'200':
"200":
content:
application/json:
schema:
type: object
properties:
data:
$ref: '../../openapi.yaml#/components/schemas/Collection'
$ref: "../../openapi.yaml#/components/schemas/Collections"
description: Successful request
'401':
$ref: '../../openapi.yaml#/components/responses/UnauthorizedError'
'404':
$ref: '../../openapi.yaml#/components/responses/NotFoundError'
"401":
$ref: "../../openapi.yaml#/components/responses/UnauthorizedError"
"404":
$ref: "../../openapi.yaml#/components/responses/NotFoundError"
tags:
- Collections
- Collections
delete:
description: "Delete an existing collection. Warning: This will delete the whole collection, including the items within. Proceed with caution."
operationId: deleteCollection
responses:
'200':
"200":
description: Successful request
'401':
$ref: '../../openapi.yaml#/components/responses/UnauthorizedError'
'404':
$ref: '../../openapi.yaml#/components/responses/NotFoundError'
"401":
$ref: "../../openapi.yaml#/components/responses/UnauthorizedError"
"404":
$ref: "../../openapi.yaml#/components/responses/NotFoundError"
tags:
- Collections
- Collections
parameters:
- name: collection
- name: id
in: path
required: true
description: The unique name of the collection.
description: Unique identifier of the collection.
schema:
type: string
type: string

View File

@@ -2,11 +2,11 @@ get:
description: Returns a list of the collections available in the project.
operationId: getCollections
parameters:
- $ref: '../../openapi.yaml#/components/parameters/Offset'
- $ref: '../../openapi.yaml#/components/parameters/Single'
- $ref: '../../openapi.yaml#/components/parameters/Meta'
- $ref: "../../openapi.yaml#/components/parameters/Offset"
- $ref: "../../openapi.yaml#/components/parameters/Single"
- $ref: "../../openapi.yaml#/components/parameters/Meta"
responses:
'200':
"200":
description: Successful request
content:
application/json:
@@ -16,63 +16,100 @@ get:
data:
type: array
items:
$ref: '../../openapi.yaml#/components/schemas/Collection'
'401':
$ref: '../../openapi.yaml#/components/responses/UnauthorizedError'
'404':
$ref: '../../openapi.yaml#/components/responses/NotFoundError'
$ref: "../../openapi.yaml#/components/schemas/Collections"
"401":
$ref: "../../openapi.yaml#/components/responses/UnauthorizedError"
"404":
$ref: "../../openapi.yaml#/components/responses/NotFoundError"
tags:
- Collections
- Collections
post:
description: Create a new collection in Directus.
operationId: createCollection
parameters:
- $ref: '../../openapi.yaml#/components/parameters/Meta'
- $ref: "../../openapi.yaml#/components/parameters/Meta"
requestBody:
content:
application/json:
schema:
type: object
required: [ collection, fields ]
required: [collection, fields]
properties:
collection:
type: string
description: Unique name of the collection.
example: my_collection
fields:
type: object
type: array
description: The fields contained in this collection. See the fields reference for more information. Each individual field requires field, type, and interface to be provided.
note:
type: string
description: A note describing the collection.
hidden:
type: string
description: Whether or not the collection is hidden from the navigation in the admin app.
single:
type: string
description: Whether or not the collection is treated as a single record.
managed:
type: string
description: If Directus is tracking and managing this collection currently.
items:
type: object
icon:
type: string
description: Name of a Google Material Design Icon that's assigned to this collection.
translation:
type: string
example: people
nullable: true
note:
description: A note describing the collection.
type: string
example: null
nullable: true
display_template:
description: Text representation of how items from this collection are shown across the system.
type: string
example: null
nullable: true
hidden:
description: Whether or not the collection is hidden from the navigation in the admin app.
type: boolean
example: false
singleton:
description: Whether or not the collection is treated as a single object.
type: boolean
example: false
translation:
description: Key value pairs of how to show this collection's name in different languages in the admin app.
type: string
example: null
nullable: true
archive_field:
description: What field holds the archive value.
type: string
example: null
nullable: true
archive_app_filter:
description: What value to use for "archived" items.
type: string
example: null
nullable: true
archive_value:
description: What value to use to "unarchive" items.
type: string
example: null
nullable: true
unarchive_value:
description: Whether or not to show the "archived" filter.
type: string
example: null
nullable: true
sort_field:
description: The sort field in the collection.
type: string
example: null
nullable: true
responses:
'200':
"200":
content:
application/json:
schema:
type: object
properties:
data:
$ref: '../../openapi.yaml#/components/schemas/Collection'
$ref: "../../openapi.yaml#/components/schemas/Collections"
description: Successful request
'401':
$ref: '../../openapi.yaml#/components/responses/UnauthorizedError'
'404':
$ref: '../../openapi.yaml#/components/responses/NotFoundError'
"401":
$ref: "../../openapi.yaml#/components/responses/UnauthorizedError"
"404":
$ref: "../../openapi.yaml#/components/responses/NotFoundError"
tags:
- Collections
- Collections

View File

@@ -0,0 +1,21 @@
get:
description: List all installed custom displays.
operationId: getDisplays
responses:
"200":
content:
application/json:
schema:
type: object
properties:
data:
type: array
items:
type: object
description: Successful request
"401":
$ref: "../../openapi.yaml#/components/responses/UnauthorizedError"
"404":
$ref: "../../openapi.yaml#/components/responses/NotFoundError"
tags:
- Extensions

View File

@@ -2,7 +2,7 @@ get:
description: List all installed custom interfaces.
operationId: getInterfaces
responses:
'200':
"200":
description: Successful request
content:
application/json:
@@ -13,9 +13,9 @@ get:
type: array
items:
type: object
'401':
$ref: '../../openapi.yaml#/components/responses/UnauthorizedError'
'404':
$ref: '../../openapi.yaml#/components/responses/NotFoundError'
"401":
$ref: "../../openapi.yaml#/components/responses/UnauthorizedError"
"404":
$ref: "../../openapi.yaml#/components/responses/NotFoundError"
tags:
- Extensions
- Extensions

View File

@@ -2,7 +2,7 @@ get:
description: List all installed custom layouts.
operationId: getLayouts
responses:
'200':
"200":
content:
application/json:
schema:
@@ -13,9 +13,9 @@ get:
items:
type: object
description: Successful request
'401':
$ref: '../../openapi.yaml#/components/responses/UnauthorizedError'
'404':
$ref: '../../openapi.yaml#/components/responses/NotFoundError'
"401":
$ref: "../../openapi.yaml#/components/responses/UnauthorizedError"
"404":
$ref: "../../openapi.yaml#/components/responses/NotFoundError"
tags:
- Extensions
- Extensions

View File

@@ -2,7 +2,7 @@ get:
description: List all installed custom modules.
operationId: getModules
responses:
'200':
"200":
content:
application/json:
schema:
@@ -13,9 +13,9 @@ get:
items:
type: object
description: Successful request
'401':
$ref: '../../openapi.yaml#/components/responses/UnauthorizedError'
'404':
$ref: '../../openapi.yaml#/components/responses/NotFoundError'
"401":
$ref: "../../openapi.yaml#/components/responses/UnauthorizedError"
"404":
$ref: "../../openapi.yaml#/components/responses/NotFoundError"
tags:
- Extensions
- Extensions

View File

@@ -2,7 +2,7 @@ get:
description: Retrieves the details of a single field in a given collection.
operationId: getCollectionField
responses:
'200':
"200":
description: Successful request
content:
application/json:
@@ -10,13 +10,13 @@ get:
type: object
properties:
data:
$ref: '../../openapi.yaml#/components/schemas/Field'
'401':
$ref: '../../openapi.yaml#/components/responses/UnauthorizedError'
'404':
$ref: '../../openapi.yaml#/components/responses/NotFoundError'
$ref: "../../openapi.yaml#/components/schemas/Fields"
"401":
$ref: "../../openapi.yaml#/components/responses/UnauthorizedError"
"404":
$ref: "../../openapi.yaml#/components/responses/NotFoundError"
tags:
- Fields
- Fields
patch:
description: Update an existing field.
operationId: updateField
@@ -24,68 +24,172 @@ patch:
content:
application/json:
schema:
properties:
datatype:
description: SQL datatype of the column that corresponds to this field.
type: string
auto_increment:
description: If the value in this field is auto incremented. Only applies to integer type fields.
type: boolean
group:
description: What field group this field is part of.
type: string
hidden_browse:
description: If this field should be hidden from the item browse (listing) page.
type: boolean
hidden_detail:
description: If this field should be hidden from the item detail (edit) page.
type: boolean
interface:
description: What interface is used in the admin app to edit the value for this field.
type: string
locked:
description: If the field can be altered by the end user. Directus system fields have this value set to `true`.
type: boolean
note:
description: A user provided note for the field. Will be rendered alongside the interface on the edit page.
type: string
options:
description: Options for the interface that's used. This format is based on the individual interface.
type: object
primary_key:
description: If this field is the primary key of the collection.
type: boolean
readonly:
description: Prevents the user from editing the value in the field.
type: boolean
required:
description: If this field requires a value.
type: boolean
signed:
description: If the value is signed or not. Only applies to integer type fields.
type: boolean
sort:
description: Sort order of this field on the edit page of the admin app.
type: integer
translation:
description: 'Key value pair of `<locale>: <translation>` that allows the user to change the displayed name of the field in the admin app.'
type: object
unique:
description: If the value of this field should be unique within the collection.
type: boolean
validation:
description: User provided regex that will be used in the API to validate incoming values.
type: string
width:
description: Width of the field on the edit form.
type: string
enum: [half, half-left, half-right, full, fill]
length:
description: Length of the field. Will be used in SQL to set the length property of the colummn. Requirement of this attribute depends on the provided datatype.
type: integer
type: object
properties:
field:
description: Unique name of the field. Field name is unique within the collection.
example: id
type: string
type:
description: Directus specific data type. Used to cast values in the API.
example: integer
type: string
schema:
description: The schema info.
type: object
properties:
name:
description: The name of the field.
example: title
type: string
table:
description: The collection of the field.
example: posts
type: string
type:
description: The type of the field.
example: string
type: string
default_value:
description: The default value of the field.
example: null
type: string
nullable: true
max_length:
description: The max length of the field.
example: null
type: integer
nullable: true
is_nullable:
description: If the field is nullable.
example: false
type: boolean
is_primary_key:
description: If the field is primary key.
example: false
type: boolean
has_auto_increment:
description: If the field has auto increment.
example: false
type: boolean
foreign_key_column:
description: Related column from the foreign key constraint.
example: null
type: string
nullable: true
foreign_key_table:
description: Related table from the foreign key constraint.
example: null
type: string
nullable: true
comment:
description: Comment as saved in the database.
example: null
type: string
nullable: true
schema:
description: Database schema (pg only).
example: public
type: string
foreign_key_schema:
description: Related schema from the foreign key constraint (pg only).
example: null
type: string
nullable: true
meta:
description: The meta info.
type: object
nullable: true
properties:
id:
description: Unique identifier for the field in the `directus_fields` collection.
example: 3
type: integer
collection:
description: Unique name of the collection this field is in.
example: posts
type: string
field:
description: Unique name of the field. Field name is unique within the collection.
example: title
type: string
special:
description: Transformation flag for field
example: null
type: array
items:
type: string
nullable: true
interface:
description:
What interface is used in the admin app to edit the value for this
field.
example: primary-key
type: string
nullable: true
options:
description:
Options for the interface that's used. This format is based on the
individual interface.
example: null
type: object
nullable: true
display:
description: What display is used in the admin app to display the value for this field.
example: null
type: string
nullable: true
display_options:
description: Options for the display that's used. This format is based on the individual display.
example: null
type: object
nullable: true
locked:
description:
If the field can be altered by the end user. Directus system fields
have this value set to `true`.
example: true
type: boolean
readonly:
description: Prevents the user from editing the value in the field.
example: false
type: boolean
hidden:
description: If this field should be hidden.
example: true
type: boolean
sort:
description: Sort order of this field on the edit page of the admin app.
example: 1
type: integer
nullable: true
width:
description: Width of the field on the edit form.
example: null
type: string
nullable: true
enum: [half, half-left, half-right, full, fill, null]
group:
description: What field group this field is part of.
example: null
type: integer
nullable: true
translation:
description:
"Key value pair of `<locale>: <translation>` that allows the user
to change the displayed name of the field in the admin app."
example: null
type: object
nullable: true
note:
description:
A user provided note for the field. Will be rendered alongside the
interface on the edit page.
example: ""
type: string
nullable: true
responses:
'200':
"200":
description: Successful request
content:
application/json:
@@ -93,26 +197,25 @@ patch:
type: object
properties:
data:
$ref: '../../openapi.yaml#/components/schemas/Field'
'401':
$ref: '../../openapi.yaml#/components/responses/UnauthorizedError'
'404':
$ref: '../../openapi.yaml#/components/responses/NotFoundError'
$ref: "../../openapi.yaml#/components/schemas/Fields"
"401":
$ref: "../../openapi.yaml#/components/responses/UnauthorizedError"
"404":
$ref: "../../openapi.yaml#/components/responses/NotFoundError"
tags:
- Fields
- Fields
delete:
description: Delete an existing field.
operationId: deleteField
responses:
'200':
"200":
description: Successful request
'401':
$ref: '../../openapi.yaml#/components/responses/UnauthorizedError'
'404':
$ref: '../../openapi.yaml#/components/responses/NotFoundError'
"401":
$ref: "../../openapi.yaml#/components/responses/UnauthorizedError"
"404":
$ref: "../../openapi.yaml#/components/responses/NotFoundError"
tags:
- Fields
- Fields
parameters:
- name: collection
in: path
@@ -120,9 +223,9 @@ parameters:
schema:
type: string
required: true
- name: field
- name: id
in: path
description: The unique name of the field.
description: Unique identifier of the field.
schema:
type: string
required: true
required: true

View File

@@ -2,9 +2,9 @@ get:
description: Returns a list of the fields available in the given collection.
operationId: getCollectionFields
parameters:
- $ref: '../../openapi.yaml#/components/parameters/Sort'
- $ref: "../../openapi.yaml#/components/parameters/Sort"
responses:
'200':
"200":
description: Successful request
content:
application/json:
@@ -14,13 +14,13 @@ get:
data:
type: array
items:
$ref: '../../openapi.yaml#/components/schemas/Field'
'401':
$ref: '../../openapi.yaml#/components/responses/UnauthorizedError'
'404':
$ref: '../../openapi.yaml#/components/responses/NotFoundError'
$ref: "../../openapi.yaml#/components/schemas/Fields"
"401":
$ref: "../../openapi.yaml#/components/responses/UnauthorizedError"
"404":
$ref: "../../openapi.yaml#/components/responses/NotFoundError"
tags:
- Fields
- Fields
post:
description: Create a new field in a given collection.
operationId: createField
@@ -28,93 +28,191 @@ post:
content:
application/json:
schema:
required: [ field, datatype, type, length ]
required: [field, datatype, type, length]
type: object
properties:
field:
description: Unique name of the field. Field name is unique within the collection.
type: string
datatype:
description: SQL datatype of the column that corresponds to this field.
example: id
type: string
type:
description: Directus specific data type. Used to cast values in the API.
example: integer
type: string
auto_increment:
description: If the value in this field is auto incremented. Only applies to integer type fields.
type: boolean
group:
description: What field group this field is part of.
type: string
hidden_browse:
description: If this field should be hidden from the item browse (listing) page.
type: boolean
hidden_detail:
description: If this field should be hidden from the item detail (edit) page.
type: boolean
interface:
description: What interface is used in the admin app to edit the value for this field.
type: string
locked:
description: If the field can be altered by the end user. Directus system fields have this value set to `true`.
type: boolean
note:
description: A user provided note for the field. Will be rendered alongside the interface on the edit page.
type: string
options:
description: Options for the interface that's used. This format is based on the individual interface.
schema:
description: The schema info.
type: object
primary_key:
description: If this field is the primary key of the collection.
type: boolean
readonly:
description: Prevents the user from editing the value in the field.
type: boolean
required:
description: If this field requires a value.
type: boolean
signed:
description: If the value is signed or not. Only applies to integer type fields.
type: boolean
sort:
description: Sort order of this field on the edit page of the admin app.
type: integer
translation:
description: 'Key value pair of `<locale>: <translation>` that allows the user to change the displayed name of the field in the admin app.'
properties:
name:
description: The name of the field.
example: title
type: string
table:
description: The collection of the field.
example: posts
type: string
type:
description: The type of the field.
example: string
type: string
default_value:
description: The default value of the field.
example: null
type: string
nullable: true
max_length:
description: The max length of the field.
example: null
type: integer
nullable: true
is_nullable:
description: If the field is nullable.
example: false
type: boolean
is_primary_key:
description: If the field is primary key.
example: false
type: boolean
has_auto_increment:
description: If the field has auto increment.
example: false
type: boolean
foreign_key_column:
description: Related column from the foreign key constraint.
example: null
type: string
nullable: true
foreign_key_table:
description: Related table from the foreign key constraint.
example: null
type: string
nullable: true
comment:
description: Comment as saved in the database.
example: null
type: string
nullable: true
schema:
description: Database schema (pg only).
example: public
type: string
foreign_key_schema:
description: Related schema from the foreign key constraint (pg only).
example: null
type: string
nullable: true
meta:
description: The meta info.
type: object
unique:
description: If the value of this field should be unique within the collection.
type: boolean
validation:
description: User provided regex that will be used in the API to validate incoming values.
type: string
width:
description: Width of the field on the edit form.
type: string
enum: [half, half-left, half-right, full, fill]
length:
description: Length of the field. Will be used in SQL to set the length property of the colummn. Requirement of this attribute depends on the provided datatype.
type: integer
type: object
nullable: true
properties:
id:
description: Unique identifier for the field in the `directus_fields` collection.
example: 3
type: integer
collection:
description: Unique name of the collection this field is in.
example: posts
type: string
field:
description: Unique name of the field. Field name is unique within the collection.
example: title
type: string
special:
description: Transformation flag for field
example: null
type: array
items:
type: string
nullable: true
interface:
description:
What interface is used in the admin app to edit the value for this
field.
example: primary-key
type: string
nullable: true
options:
description:
Options for the interface that's used. This format is based on the
individual interface.
example: null
type: object
nullable: true
display:
description: What display is used in the admin app to display the value for this field.
example: null
type: string
nullable: true
display_options:
description: Options for the display that's used. This format is based on the individual display.
example: null
type: object
nullable: true
locked:
description:
If the field can be altered by the end user. Directus system fields
have this value set to `true`.
example: true
type: boolean
readonly:
description: Prevents the user from editing the value in the field.
example: false
type: boolean
hidden:
description: If this field should be hidden.
example: true
type: boolean
sort:
description: Sort order of this field on the edit page of the admin app.
example: 1
type: integer
nullable: true
width:
description: Width of the field on the edit form.
example: null
type: string
nullable: true
enum: [half, half-left, half-right, full, fill, null]
group:
description: What field group this field is part of.
example: null
type: integer
nullable: true
translation:
description:
"Key value pair of `<locale>: <translation>` that allows the user
to change the displayed name of the field in the admin app."
example: null
type: object
nullable: true
note:
description:
A user provided note for the field. Will be rendered alongside the
interface on the edit page.
example: ""
type: string
nullable: true
responses:
'200':
"200":
content:
application/json:
schema:
type: object
properties:
data:
$ref: '../../openapi.yaml#/components/schemas/Field'
$ref: "../../openapi.yaml#/components/schemas/Fields"
description: Successful request
'401':
$ref: '../../openapi.yaml#/components/responses/UnauthorizedError'
'404':
$ref: '../../openapi.yaml#/components/responses/NotFoundError'
"401":
$ref: "../../openapi.yaml#/components/responses/UnauthorizedError"
"404":
$ref: "../../openapi.yaml#/components/responses/NotFoundError"
tags:
- Fields
- Fields
parameters:
- description: Unique identifier of the collection the item resides in.
in: path
name: collection
required: true
schema:
type: string
type: string

View File

@@ -2,10 +2,10 @@ get:
description: Returns a list of the fields available in the project.
operationId: getFields
parameters:
- $ref: '../../openapi.yaml#/components/parameters/Limit'
- $ref: '../../openapi.yaml#/components/parameters/Sort'
- $ref: "../../openapi.yaml#/components/parameters/Limit"
- $ref: "../../openapi.yaml#/components/parameters/Sort"
responses:
'200':
"200":
description: Successful request
content:
application/json:
@@ -15,10 +15,10 @@ get:
data:
type: array
items:
$ref: '../../openapi.yaml#/components/schemas/Field'
'401':
$ref: '../../openapi.yaml#/components/responses/UnauthorizedError'
'404':
$ref: '../../openapi.yaml#/components/responses/NotFoundError'
$ref: "../../openapi.yaml#/components/schemas/Fields"
"401":
$ref: "../../openapi.yaml#/components/responses/UnauthorizedError"
"404":
$ref: "../../openapi.yaml#/components/responses/NotFoundError"
tags:
- Fields
- Fields

View File

@@ -4,7 +4,7 @@ get:
- Files
operationId: getFile
responses:
'200':
"200":
description: Successful request
content:
application/json:
@@ -12,9 +12,9 @@ get:
type: object
properties:
data:
$ref: '../../openapi.yaml#/components/schemas/File'
'401':
$ref: '../../openapi.yaml#/components/responses/UnauthorizedError'
$ref: "../../openapi.yaml#/components/schemas/Files"
"401":
$ref: "../../openapi.yaml#/components/responses/UnauthorizedError"
patch:
description: Update an existing file.
tags:
@@ -26,7 +26,7 @@ patch:
schema:
type: object
responses:
'200':
"200":
description: Successful request
content:
application/json:
@@ -34,18 +34,18 @@ patch:
type: object
properties:
data:
$ref: '../../openapi.yaml#/components/schemas/File'
'401':
$ref: '../../openapi.yaml#/components/responses/UnauthorizedError'
$ref: "../../openapi.yaml#/components/schemas/Files"
"401":
$ref: "../../openapi.yaml#/components/responses/UnauthorizedError"
delete:
description: Delete an existing file.
tags:
- Files
operationId: deleteFile
responses:
'200':
"200":
description: Successful request
'401':
$ref: '../../openapi.yaml#/components/responses/UnauthorizedError'
"401":
$ref: "../../openapi.yaml#/components/responses/UnauthorizedError"
parameters:
- $ref: '../../openapi.yaml#/components/parameters/Id'
- $ref: "../../openapi.yaml#/components/parameters/Id"

View File

@@ -4,7 +4,7 @@ get:
- Files
operationId: getFiles
responses:
'200':
"200":
description: Successful request
content:
application/json:
@@ -14,9 +14,9 @@ get:
data:
type: array
items:
$ref: '../../openapi.yaml#/components/schemas/File'
'401':
$ref: '../../openapi.yaml#/components/responses/UnauthorizedError'
$ref: "../../openapi.yaml#/components/schemas/Files"
"401":
$ref: "../../openapi.yaml#/components/responses/UnauthorizedError"
post:
description: Create a new file.
tags:
@@ -31,7 +31,7 @@ post:
data:
type: string
responses:
'200':
"200":
description: Successful request
content:
application/json:
@@ -39,6 +39,6 @@ post:
type: object
properties:
data:
$ref: '../../openapi.yaml#/components/schemas/File'
'401':
$ref: '../../openapi.yaml#/components/responses/UnauthorizedError'
$ref: "../../openapi.yaml#/components/schemas/Files"
"401":
$ref: "../../openapi.yaml#/components/responses/UnauthorizedError"

View File

@@ -4,7 +4,7 @@ get:
- Files
operationId: getFileRevision
parameters:
- $ref: '../../openapi.yaml#/components/parameters/UUId'
- $ref: "../../openapi.yaml#/components/parameters/UUId"
- name: offset
in: path
description: offset or revision
@@ -12,7 +12,7 @@ get:
schema:
type: integer
responses:
'200':
"200":
description: Successful request
content:
application/json:
@@ -20,6 +20,6 @@ get:
type: object
properties:
data:
$ref: '../../openapi.yaml#/components/schemas/Revision'
'401':
$ref: '../../openapi.yaml#/components/responses/UnauthorizedError'
$ref: "../../openapi.yaml#/components/schemas/Revisions"
"401":
$ref: "../../openapi.yaml#/components/responses/UnauthorizedError"

View File

@@ -4,9 +4,9 @@ get:
- Files
operationId: getFileRevisions
parameters:
- $ref: '../../openapi.yaml#/components/parameters/UUId'
- $ref: "../../openapi.yaml#/components/parameters/UUId"
responses:
'200':
"200":
description: Successful request
content:
application/json:
@@ -16,6 +16,6 @@ get:
data:
type: array
items:
$ref: '../../openapi.yaml#/components/schemas/Revision'
'401':
$ref: '../../openapi.yaml#/components/responses/UnauthorizedError'
$ref: "../../openapi.yaml#/components/schemas/Revisions"
"401":
$ref: "../../openapi.yaml#/components/responses/UnauthorizedError"

View File

@@ -2,10 +2,10 @@ get:
description: Retrieve a single folder by unique identifier.
operationId: getFolder
parameters:
- $ref: '../../openapi.yaml#/components/parameters/Fields'
- $ref: '../../openapi.yaml#/components/parameters/Meta'
- $ref: "../../openapi.yaml#/components/parameters/Fields"
- $ref: "../../openapi.yaml#/components/parameters/Meta"
responses:
'200':
"200":
description: Successful request
content:
application/json:
@@ -13,19 +13,19 @@ get:
type: object
properties:
data:
$ref: '../../openapi.yaml#/components/schemas/Folder'
'401':
$ref: '../../openapi.yaml#/components/responses/UnauthorizedError'
'404':
$ref: '../../openapi.yaml#/components/responses/NotFoundError'
$ref: "../../openapi.yaml#/components/schemas/Folders"
"401":
$ref: "../../openapi.yaml#/components/responses/UnauthorizedError"
"404":
$ref: "../../openapi.yaml#/components/responses/NotFoundError"
tags:
- Folders
- Folders
patch:
description: Update an existing folder
operationId: updateFolder
parameters:
- $ref: '../../openapi.yaml#/components/parameters/Fields'
- $ref: '../../openapi.yaml#/components/parameters/Meta'
- $ref: "../../openapi.yaml#/components/parameters/Fields"
- $ref: "../../openapi.yaml#/components/parameters/Meta"
requestBody:
content:
application/json:
@@ -40,7 +40,7 @@ patch:
example: 3
description: Unique identifier of the parent folder. This allows for nested folders.
responses:
'200':
"200":
description: Successful request
content:
application/json:
@@ -48,25 +48,25 @@ patch:
type: object
properties:
data:
$ref: '../../openapi.yaml#/components/schemas/Folder'
'401':
$ref: '../../openapi.yaml#/components/responses/UnauthorizedError'
'404':
$ref: '../../openapi.yaml#/components/responses/NotFoundError'
$ref: "../../openapi.yaml#/components/schemas/Folders"
"401":
$ref: "../../openapi.yaml#/components/responses/UnauthorizedError"
"404":
$ref: "../../openapi.yaml#/components/responses/NotFoundError"
tags:
- Folders
- Folders
delete:
description: Delete an existing folder
operationId: deleteFolder
responses:
'200':
"200":
description: Successful request
'401':
$ref: '../../openapi.yaml#/components/responses/UnauthorizedError'
'404':
$ref: '../../openapi.yaml#/components/responses/NotFoundError'
"401":
$ref: "../../openapi.yaml#/components/responses/UnauthorizedError"
"404":
$ref: "../../openapi.yaml#/components/responses/NotFoundError"
tags:
- Folders
- Folders
parameters:
- $ref: '../../openapi.yaml#/components/parameters/UUId'
- $ref: "../../openapi.yaml#/components/parameters/UUId"

View File

@@ -2,16 +2,16 @@ get:
description: List the folders.
operationId: getFolders
parameters:
- $ref: '../../openapi.yaml#/components/parameters/Fields'
- $ref: '../../openapi.yaml#/components/parameters/Limit'
- $ref: '../../openapi.yaml#/components/parameters/Offset'
- $ref: '../../openapi.yaml#/components/parameters/Sort'
- $ref: '../../openapi.yaml#/components/parameters/Single'
- $ref: '../../openapi.yaml#/components/parameters/Filter'
- $ref: '../../openapi.yaml#/components/parameters/q'
- $ref: '../../openapi.yaml#/components/parameters/Meta'
- $ref: "../../openapi.yaml#/components/parameters/Fields"
- $ref: "../../openapi.yaml#/components/parameters/Limit"
- $ref: "../../openapi.yaml#/components/parameters/Offset"
- $ref: "../../openapi.yaml#/components/parameters/Sort"
- $ref: "../../openapi.yaml#/components/parameters/Single"
- $ref: "../../openapi.yaml#/components/parameters/Filter"
- $ref: "../../openapi.yaml#/components/parameters/Search"
- $ref: "../../openapi.yaml#/components/parameters/Meta"
responses:
'200':
"200":
description: Successful request
content:
application/json:
@@ -21,19 +21,19 @@ get:
data:
type: array
items:
$ref: '../../openapi.yaml#/components/schemas/Folder'
'401':
$ref: '../../openapi.yaml#/components/responses/UnauthorizedError'
'404':
$ref: '../../openapi.yaml#/components/responses/NotFoundError'
$ref: "../../openapi.yaml#/components/schemas/Folders"
"401":
$ref: "../../openapi.yaml#/components/responses/UnauthorizedError"
"404":
$ref: "../../openapi.yaml#/components/responses/NotFoundError"
tags:
- Folders
- Folders
post:
description: Create a new folder.
operationId: createFolder
parameters:
- $ref: '../../openapi.yaml#/components/parameters/Fields'
- $ref: '../../openapi.yaml#/components/parameters/Meta'
- $ref: "../../openapi.yaml#/components/parameters/Fields"
- $ref: "../../openapi.yaml#/components/parameters/Meta"
requestBody:
content:
application/json:
@@ -49,7 +49,7 @@ post:
type: integer
required: [name]
responses:
'200':
"200":
description: Successful request
content:
application/json:
@@ -57,10 +57,10 @@ post:
type: object
properties:
data:
$ref: '../../openapi.yaml#/components/schemas/Folder'
'401':
$ref: '../../openapi.yaml#/components/responses/UnauthorizedError'
'404':
$ref: '../../openapi.yaml#/components/responses/NotFoundError'
$ref: "../../openapi.yaml#/components/schemas/Folders"
"401":
$ref: "../../openapi.yaml#/components/responses/UnauthorizedError"
"404":
$ref: "../../openapi.yaml#/components/responses/NotFoundError"
tags:
- Folders

View File

@@ -4,10 +4,10 @@ get:
- Items
operationId: getItem
parameters:
- $ref: '../../openapi.yaml#/components/parameters/Fields'
- $ref: '../../openapi.yaml#/components/parameters/Meta'
- $ref: "../../openapi.yaml#/components/parameters/Fields"
- $ref: "../../openapi.yaml#/components/parameters/Meta"
responses:
'200':
"200":
description: Successful request
content:
application/json:
@@ -16,25 +16,25 @@ get:
properties:
data:
type: object
'401':
$ref: '../../openapi.yaml#/components/responses/UnauthorizedError'
'404':
$ref: '../../openapi.yaml#/components/responses/NotFoundError'
"401":
$ref: "../../openapi.yaml#/components/responses/UnauthorizedError"
"404":
$ref: "../../openapi.yaml#/components/responses/NotFoundError"
patch:
description: Update an existing item.
tags:
- Items
operationId: updateItem
parameters:
- $ref: '../../openapi.yaml#/components/parameters/Fields'
- $ref: '../../openapi.yaml#/components/parameters/Meta'
- $ref: "../../openapi.yaml#/components/parameters/Fields"
- $ref: "../../openapi.yaml#/components/parameters/Meta"
requestBody:
content:
application/json:
schema:
type: object
responses:
'200':
"200":
description: Successful request
content:
application/json:
@@ -43,24 +43,24 @@ patch:
properties:
data:
type: object
'401':
$ref: '../../openapi.yaml#/components/responses/UnauthorizedError'
'404':
$ref: '../../openapi.yaml#/components/responses/NotFoundError'
"401":
$ref: "../../openapi.yaml#/components/responses/UnauthorizedError"
"404":
$ref: "../../openapi.yaml#/components/responses/NotFoundError"
delete:
description: Delete an existing item.
tags:
- Items
operationId: deleteItem
responses:
'200':
"200":
description: Successful request
'401':
$ref: '../../openapi.yaml#/components/responses/UnauthorizedError'
'404':
$ref: '../../openapi.yaml#/components/responses/NotFoundError'
"401":
$ref: "../../openapi.yaml#/components/responses/UnauthorizedError"
"404":
$ref: "../../openapi.yaml#/components/responses/NotFoundError"
parameters:
- $ref: '../../openapi.yaml#/components/parameters/Collection'
- $ref: "../../openapi.yaml#/components/parameters/Collection"
- name: id
description: Index of the item.
in: path
@@ -72,4 +72,4 @@ parameters:
example: 1
- type: string
description: Unique identifier of the item.
example: 8cbb43fe-4cdf-4991-8352-c461779cec02
example: 8cbb43fe-4cdf-4991-8352-c461779cec02

View File

@@ -3,27 +3,19 @@ get:
tags:
- Items
operationId: getItems
security:
security:
- Auth: []
parameters:
- $ref: '../../openapi.yaml#/components/parameters/Fields'
- $ref: '../../openapi.yaml#/components/parameters/Limit'
- $ref: '../../openapi.yaml#/components/parameters/Meta'
- $ref: '../../openapi.yaml#/components/parameters/Offset'
- $ref: '../../openapi.yaml#/components/parameters/Single'
- $ref: '../../openapi.yaml#/components/parameters/Sort'
- $ref: '../../openapi.yaml#/components/parameters/Filter'
- $ref: '../../openapi.yaml#/components/parameters/q'
- name: status
in: query
description: Filter items by the given status
explode: false
schema:
type: array
items:
type: string
- $ref: "../../openapi.yaml#/components/parameters/Fields"
- $ref: "../../openapi.yaml#/components/parameters/Limit"
- $ref: "../../openapi.yaml#/components/parameters/Meta"
- $ref: "../../openapi.yaml#/components/parameters/Offset"
- $ref: "../../openapi.yaml#/components/parameters/Single"
- $ref: "../../openapi.yaml#/components/parameters/Sort"
- $ref: "../../openapi.yaml#/components/parameters/Filter"
- $ref: "../../openapi.yaml#/components/parameters/Search"
responses:
'200':
"200":
description: Successful request
content:
application/json:
@@ -34,28 +26,28 @@ get:
type: array
items:
type: object
'401':
$ref: '../../openapi.yaml#/components/responses/UnauthorizedError'
"401":
$ref: "../../openapi.yaml#/components/responses/UnauthorizedError"
post:
description: Create a new item.
tags:
- Items
operationId: createItem
parameters:
- $ref: '../../openapi.yaml#/components/parameters/Meta'
- $ref: "../../openapi.yaml#/components/parameters/Meta"
requestBody:
content:
application/json:
schema:
type: object
responses:
'200':
"200":
description: Successful request
content:
application/json:
schema:
type: object
'401':
$ref: '../../openapi.yaml#/components/responses/UnauthorizedError'
"401":
$ref: "../../openapi.yaml#/components/responses/UnauthorizedError"
parameters:
- $ref: '../../openapi.yaml#/components/parameters/Collection'
- $ref: "../../openapi.yaml#/components/parameters/Collection"

View File

@@ -1,52 +0,0 @@
post:
description: Send an email
operationId: sendMail
requestBody:
content:
application/json:
schema:
type: object
properties:
to:
description: User ID, email address, or object in the format { email, name }. You can send an email to multiple people at the same time by passing an array here.
type: array
example: ["user@example.com", "admin@example.com"]
items:
type: string
format: email
body:
description: Body of the email.
type: string
example: "Hello <b>{{name}}</b>, this is your new password: {{password}}."
data:
description: Key value pairs of variables that can be used in the body.
type: object
properties:
name:
type: string
example: John Doe
password:
type: string
example: secret
subject:
description: Email subject.
type: string
example: New Password
type:
description: HTML or plain text
example: html
type: string
enum: [html, text]
responses:
'200':
content:
application/json:
schema:
type: string
description: Successful request
'401':
$ref: '../../openapi.yaml#/components/responses/UnauthorizedError'
'404':
$ref: '../../openapi.yaml#/components/responses/NotFoundError'
tags:
- Mail

View File

@@ -2,10 +2,10 @@ get:
description: Retrieve a single permissions object by unique identifier.
operationId: getPermission
parameters:
- $ref: '../../openapi.yaml#/components/parameters/Fields'
- $ref: '../../openapi.yaml#/components/parameters/Meta'
- $ref: "../../openapi.yaml#/components/parameters/Fields"
- $ref: "../../openapi.yaml#/components/parameters/Meta"
responses:
'200':
"200":
description: Successful request
content:
application/json:
@@ -13,18 +13,18 @@ get:
type: object
properties:
data:
$ref: '../../openapi.yaml#/components/schemas/Permissions'
'401':
$ref: '../../openapi.yaml#/components/responses/UnauthorizedError'
'404':
$ref: '../../openapi.yaml#/components/responses/NotFoundError'
$ref: "../../openapi.yaml#/components/schemas/Permissions"
"401":
$ref: "../../openapi.yaml#/components/responses/UnauthorizedError"
"404":
$ref: "../../openapi.yaml#/components/responses/NotFoundError"
tags:
- Permissions
- Permissions
patch:
description: Update an existing permission
operationId: updatePermission
parameters:
- $ref: '../../openapi.yaml#/components/parameters/Meta'
- $ref: "../../openapi.yaml#/components/parameters/Meta"
requestBody:
content:
application/json:
@@ -75,7 +75,7 @@ patch:
type: object
type: object
responses:
'200':
"200":
description: Successful request
content:
application/json:
@@ -83,24 +83,24 @@ patch:
type: object
properties:
data:
$ref: '../../openapi.yaml#/components/schemas/Permissions'
'401':
$ref: '../../openapi.yaml#/components/responses/UnauthorizedError'
'404':
$ref: '../../openapi.yaml#/components/responses/NotFoundError'
$ref: "../../openapi.yaml#/components/schemas/Permissions"
"401":
$ref: "../../openapi.yaml#/components/responses/UnauthorizedError"
"404":
$ref: "../../openapi.yaml#/components/responses/NotFoundError"
tags:
- Permissions
- Permissions
delete:
description: Delete an existing permission
operationId: deletePermission
responses:
'200':
"200":
description: Successful request
'401':
$ref: '../../openapi.yaml#/components/responses/UnauthorizedError'
'404':
$ref: '../../openapi.yaml#/components/responses/NotFoundError'
"401":
$ref: "../../openapi.yaml#/components/responses/UnauthorizedError"
"404":
$ref: "../../openapi.yaml#/components/responses/NotFoundError"
tags:
- Permissions
- Permissions
parameters:
- $ref: '../../openapi.yaml#/components/parameters/Id'
- $ref: "../../openapi.yaml#/components/parameters/Id"

View File

@@ -1,23 +0,0 @@
get:
description: List the permissions that apply to the current user for the given collection
operationId: Enter text here
parameters:
- $ref: '../../openapi.yaml#/components/parameters/Collection'
responses:
'200':
description: Successful request
content:
application/json:
schema:
type: object
properties:
data:
type: array
items:
$ref: '../../openapi.yaml#/components/schemas/Permissions'
'401':
$ref: '../../openapi.yaml#/components/responses/UnauthorizedError'
'404':
$ref: '../../openapi.yaml#/components/responses/NotFoundError'
tags:
- Permissions

View File

@@ -2,7 +2,7 @@ get:
description: List the permissions that apply to the current user.
operationId: getMyPermissions
responses:
'200':
"200":
description: Successful request
content:
application/json:
@@ -12,10 +12,10 @@ get:
data:
type: array
items:
$ref: '../../openapi.yaml#/components/schemas/Permissions'
'401':
$ref: '../../openapi.yaml#/components/responses/UnauthorizedError'
'404':
$ref: '../../openapi.yaml#/components/responses/NotFoundError'
$ref: "../../openapi.yaml#/components/schemas/Permissions"
"401":
$ref: "../../openapi.yaml#/components/responses/UnauthorizedError"
"404":
$ref: "../../openapi.yaml#/components/responses/NotFoundError"
tags:
- Permissions
- Permissions

View File

@@ -2,17 +2,17 @@ get:
description: List all permissions.
operationId: getPermissions
parameters:
- $ref: '../../openapi.yaml#/components/parameters/Fields'
- $ref: '../../openapi.yaml#/components/parameters/Limit'
- $ref: '../../openapi.yaml#/components/parameters/Offset'
- $ref: '../../openapi.yaml#/components/parameters/Single'
- $ref: '../../openapi.yaml#/components/parameters/Meta'
- $ref: '../../openapi.yaml#/components/parameters/Sort'
- $ref: '../../openapi.yaml#/components/parameters/Filter'
- $ref: '../../openapi.yaml#/components/parameters/q'
- $ref: '../../openapi.yaml#/components/parameters/Page'
- $ref: "../../openapi.yaml#/components/parameters/Fields"
- $ref: "../../openapi.yaml#/components/parameters/Limit"
- $ref: "../../openapi.yaml#/components/parameters/Offset"
- $ref: "../../openapi.yaml#/components/parameters/Single"
- $ref: "../../openapi.yaml#/components/parameters/Meta"
- $ref: "../../openapi.yaml#/components/parameters/Sort"
- $ref: "../../openapi.yaml#/components/parameters/Filter"
- $ref: "../../openapi.yaml#/components/parameters/Search"
- $ref: "../../openapi.yaml#/components/parameters/Page"
responses:
'200':
"200":
description: Successful request
content:
application/json:
@@ -22,18 +22,18 @@ get:
data:
type: array
items:
$ref: '../../openapi.yaml#/components/schemas/Permissions'
'401':
$ref: '../../openapi.yaml#/components/responses/UnauthorizedError'
'404':
$ref: '../../openapi.yaml#/components/responses/NotFoundError'
$ref: "../../openapi.yaml#/components/schemas/Permissions"
"401":
$ref: "../../openapi.yaml#/components/responses/UnauthorizedError"
"404":
$ref: "../../openapi.yaml#/components/responses/NotFoundError"
tags:
- Permissions
- Permissions
post:
description: Create a new permission.
operationId: createPermission
parameters:
- $ref: '../../openapi.yaml#/components/parameters/Meta'
- $ref: "../../openapi.yaml#/components/parameters/Meta"
requestBody:
content:
application/json:
@@ -72,7 +72,7 @@ post:
type: array
items:
type: string
example: ['featured_image']
example: ["featured_image"]
status:
description: What status this permission applies to.
type: string
@@ -92,7 +92,7 @@ post:
type: string
type: object
responses:
'200':
"200":
description: Successful request
content:
application/json:
@@ -100,10 +100,10 @@ post:
type: object
properties:
data:
$ref: '../../openapi.yaml#/components/schemas/Permissions'
'401':
$ref: '../../openapi.yaml#/components/responses/UnauthorizedError'
'404':
$ref: '../../openapi.yaml#/components/responses/NotFoundError'
$ref: "../../openapi.yaml#/components/schemas/Permissions"
"401":
$ref: "../../openapi.yaml#/components/responses/UnauthorizedError"
"404":
$ref: "../../openapi.yaml#/components/responses/NotFoundError"
tags:
- Permissions
- Permissions

View File

@@ -3,13 +3,13 @@ get:
- Presets
operationId: getPreset
description: Retrieve a single preset by unique identifier.
security:
security:
- Auth: []
parameters:
- $ref: '../../openapi.yaml#/components/parameters/Fields'
- $ref: '../../openapi.yaml#/components/parameters/Meta'
- $ref: "../../openapi.yaml#/components/parameters/Fields"
- $ref: "../../openapi.yaml#/components/parameters/Meta"
responses:
'200':
"200":
description: Successful request
content:
application/json:
@@ -17,23 +17,23 @@ get:
type: object
properties:
data:
$ref: '../../openapi.yaml#/components/schemas/Preset'
'401':
$ref: '../../openapi.yaml#/components/responses/UnauthorizedError'
$ref: "../../openapi.yaml#/components/schemas/Presets"
"401":
$ref: "../../openapi.yaml#/components/responses/UnauthorizedError"
patch:
tags:
- Presets
operationId: updatePreset
description: Update an existing preset.
parameters:
- $ref: '../../openapi.yaml#/components/parameters/Fields'
- $ref: '../../openapi.yaml#/components/parameters/Meta'
- $ref: "../../openapi.yaml#/components/parameters/Fields"
- $ref: "../../openapi.yaml#/components/parameters/Meta"
requestBody:
content:
application/json:
schema:
type: object
required: [ collection ]
required: [collection]
properties:
collection:
type: string
@@ -60,7 +60,7 @@ patch:
operator:
type: string
example: gte
value:
value:
type: integer
example: 4.5
view_type:
@@ -76,7 +76,7 @@ patch:
type: object
description: Key value pair of language-translation. Can be used to translate the bookmark title in multiple languages.
responses:
'200':
"200":
description: Successful request
content:
application/json:
@@ -84,9 +84,9 @@ patch:
type: object
properties:
data:
$ref: '../../openapi.yaml#/components/schemas/Preset'
'401':
$ref: '../../openapi.yaml#/components/responses/UnauthorizedError'
$ref: "../../openapi.yaml#/components/schemas/Presets"
"401":
$ref: "../../openapi.yaml#/components/responses/UnauthorizedError"
delete:
tags:
- Presets
@@ -95,9 +95,9 @@ delete:
security:
- Auth: []
responses:
'200':
"200":
description: Successful request
'401':
$ref: '../../openapi.yaml#/components/responses/UnauthorizedError'
"401":
$ref: "../../openapi.yaml#/components/responses/UnauthorizedError"
parameters:
- $ref: '../../openapi.yaml#/components/parameters/Id'
- $ref: "../../openapi.yaml#/components/parameters/Id"

View File

@@ -3,20 +3,20 @@ get:
- Presets
operationId: getPresets
description: List the presets.
security:
security:
- Auth: []
parameters:
- $ref: '../../openapi.yaml#/components/parameters/Fields'
- $ref: '../../openapi.yaml#/components/parameters/Limit'
- $ref: '../../openapi.yaml#/components/parameters/Offset'
- $ref: '../../openapi.yaml#/components/parameters/Page'
- $ref: '../../openapi.yaml#/components/parameters/Sort'
- $ref: '../../openapi.yaml#/components/parameters/Single'
- $ref: '../../openapi.yaml#/components/parameters/Filter'
- $ref: '../../openapi.yaml#/components/parameters/q'
- $ref: '../../openapi.yaml#/components/parameters/Meta'
- $ref: "../../openapi.yaml#/components/parameters/Fields"
- $ref: "../../openapi.yaml#/components/parameters/Limit"
- $ref: "../../openapi.yaml#/components/parameters/Offset"
- $ref: "../../openapi.yaml#/components/parameters/Page"
- $ref: "../../openapi.yaml#/components/parameters/Sort"
- $ref: "../../openapi.yaml#/components/parameters/Single"
- $ref: "../../openapi.yaml#/components/parameters/Filter"
- $ref: "../../openapi.yaml#/components/parameters/Search"
- $ref: "../../openapi.yaml#/components/parameters/Meta"
responses:
'200':
"200":
description: Successful request
content:
application/json:
@@ -26,23 +26,23 @@ get:
data:
type: array
items:
$ref: '../../openapi.yaml#/components/schemas/Preset'
'401':
$ref: '../../openapi.yaml#/components/responses/UnauthorizedError'
$ref: "../../openapi.yaml#/components/schemas/Presets"
"401":
$ref: "../../openapi.yaml#/components/responses/UnauthorizedError"
post:
tags:
- Presets
operationId: createPreset
description: Create a new preset.
parameters:
- $ref: '../../openapi.yaml#/components/parameters/Fields'
- $ref: '../../openapi.yaml#/components/parameters/Meta'
- $ref: "../../openapi.yaml#/components/parameters/Fields"
- $ref: "../../openapi.yaml#/components/parameters/Meta"
requestBody:
content:
application/json:
schema:
type: object
required: [ collection ]
required: [collection]
properties:
collection:
type: string
@@ -53,9 +53,10 @@ post:
description: Name for the bookmark. If this is set, the collection preset will be considered to be a bookmark.
example: Highly rated articles
role:
type: integer
type: string
description: The unique identifier of a role in the platform. If user is null, this will be used to apply the collection preset or bookmark for all users in the role.
search_query:
example: null
search:
type: string
description: What the user searched for in search/filter in the header bar.
filters:
@@ -63,29 +64,29 @@ post:
items:
type: object
properties:
key:
type: string
example: aHKLAakdVghzD
field:
type: string
example: rating
operator:
type: string
example: gte
value:
value:
type: integer
example: 4.5
view_type:
layout:
type: string
description: Name of the view type that is used. Defaults to tabular.
view_query:
description: Name of the view type that is used.
layout_query:
type: string
description: View query that's saved per view type. Controls what data is fetched on load. These follow the same format as the JS SDK parameters.
view_options:
description: Layout query that's saved per layout type. Controls what data is fetched on load. These follow the same format as the JS SDK parameters.
layout_options:
type: string
description: Options of the views. The properties in here are controlled by the layout.
translation:
type: object
description: Key value pair of language-translation. Can be used to translate the bookmark title in multiple languages.
responses:
'200':
"200":
description: Successful request
content:
application/json:
@@ -93,6 +94,6 @@ post:
type: object
properties:
data:
$ref: '../../openapi.yaml#/components/schemas/Preset'
'401':
$ref: '../../openapi.yaml#/components/responses/UnauthorizedError'
$ref: "../../openapi.yaml#/components/schemas/Presets"
"401":
$ref: "../../openapi.yaml#/components/responses/UnauthorizedError"

View File

@@ -2,10 +2,10 @@ get:
description: Retrieve a single relation by unique identifier.
operationId: getRelation
parameters:
- $ref: '../../openapi.yaml#/components/parameters/Fields'
- $ref: '../../openapi.yaml#/components/parameters/Meta'
- $ref: "../../openapi.yaml#/components/parameters/Fields"
- $ref: "../../openapi.yaml#/components/parameters/Meta"
responses:
'200':
"200":
description: Successful request
content:
application/json:
@@ -13,19 +13,19 @@ get:
type: object
properties:
data:
$ref: '../../openapi.yaml#/components/schemas/Relation'
'401':
$ref: '../../openapi.yaml#/components/responses/UnauthorizedError'
'404':
$ref: '../../openapi.yaml#/components/responses/NotFoundError'
$ref: "../../openapi.yaml#/components/schemas/Relations"
"401":
$ref: "../../openapi.yaml#/components/responses/UnauthorizedError"
"404":
$ref: "../../openapi.yaml#/components/responses/NotFoundError"
tags:
- Relations
- Relations
patch:
description: Update an existing relation
operationId: updateRelation
parameters:
- $ref: '../../openapi.yaml#/components/parameters/Fields'
- $ref: '../../openapi.yaml#/components/parameters/Meta'
- $ref: "../../openapi.yaml#/components/parameters/Fields"
- $ref: "../../openapi.yaml#/components/parameters/Meta"
requestBody:
content:
application/json:
@@ -38,7 +38,8 @@ patch:
description: Collection on the _one_ side of the relationship.
type: string
field_many:
description: Foreign key. Field that holds the primary key of the related
description:
Foreign key. Field that holds the primary key of the related
collection.
type: string
field_one:
@@ -46,12 +47,13 @@ patch:
type: string
example: books
junction_field:
description: Field on the junction table that holds the primary key of
description:
Field on the junction table that holds the primary key of
the related collection.
type: string
type: object
responses:
'200':
"200":
description: Successful request
content:
application/json:
@@ -59,24 +61,24 @@ patch:
type: object
properties:
data:
$ref: '../../openapi.yaml#/components/schemas/Relation'
'401':
$ref: '../../openapi.yaml#/components/responses/UnauthorizedError'
'404':
$ref: '../../openapi.yaml#/components/responses/NotFoundError'
$ref: "../../openapi.yaml#/components/schemas/Relations"
"401":
$ref: "../../openapi.yaml#/components/responses/UnauthorizedError"
"404":
$ref: "../../openapi.yaml#/components/responses/NotFoundError"
tags:
- Relations
- Relations
delete:
description: Delete an existing relation.
operationId: deleteRelation
responses:
'200':
"200":
description: Successful request
'401':
$ref: '../../openapi.yaml#/components/responses/UnauthorizedError'
'404':
$ref: '../../openapi.yaml#/components/responses/NotFoundError'
"401":
$ref: "../../openapi.yaml#/components/responses/UnauthorizedError"
"404":
$ref: "../../openapi.yaml#/components/responses/NotFoundError"
tags:
- Relations
- Relations
parameters:
- $ref: '../../openapi.yaml#/components/parameters/Id'
- $ref: "../../openapi.yaml#/components/parameters/Id"

View File

@@ -2,17 +2,17 @@ get:
description: List the relations.
operationId: getRelations
parameters:
- $ref: '../../openapi.yaml#/components/parameters/Fields'
- $ref: '../../openapi.yaml#/components/parameters/Limit'
- $ref: '../../openapi.yaml#/components/parameters/Offset'
- $ref: '../../openapi.yaml#/components/parameters/Single'
- $ref: '../../openapi.yaml#/components/parameters/Meta'
- $ref: '../../openapi.yaml#/components/parameters/Sort'
- $ref: '../../openapi.yaml#/components/parameters/Filter'
- $ref: '../../openapi.yaml#/components/parameters/q'
- $ref: '../../openapi.yaml#/components/parameters/Page'
- $ref: "../../openapi.yaml#/components/parameters/Fields"
- $ref: "../../openapi.yaml#/components/parameters/Limit"
- $ref: "../../openapi.yaml#/components/parameters/Offset"
- $ref: "../../openapi.yaml#/components/parameters/Single"
- $ref: "../../openapi.yaml#/components/parameters/Meta"
- $ref: "../../openapi.yaml#/components/parameters/Sort"
- $ref: "../../openapi.yaml#/components/parameters/Filter"
- $ref: "../../openapi.yaml#/components/parameters/Search"
- $ref: "../../openapi.yaml#/components/parameters/Page"
responses:
'200':
"200":
description: Successful request
content:
application/json:
@@ -22,19 +22,19 @@ get:
data:
type: array
items:
$ref: '../../openapi.yaml#/components/schemas/Relation'
'401':
$ref: '../../openapi.yaml#/components/responses/UnauthorizedError'
'404':
$ref: '../../openapi.yaml#/components/responses/NotFoundError'
$ref: "../../openapi.yaml#/components/schemas/Relations"
"401":
$ref: "../../openapi.yaml#/components/responses/UnauthorizedError"
"404":
$ref: "../../openapi.yaml#/components/responses/NotFoundError"
tags:
- Relations
- Relations
post:
description: Create a new relation.
operationId: createRelation
parameters:
- $ref: '../../openapi.yaml#/components/parameters/Fields'
- $ref: '../../openapi.yaml#/components/parameters/Meta'
- $ref: "../../openapi.yaml#/components/parameters/Fields"
- $ref: "../../openapi.yaml#/components/parameters/Meta"
requestBody:
content:
application/json:
@@ -61,7 +61,7 @@ post:
type: string
type: object
responses:
'200':
"200":
description: Successful request
content:
application/json:
@@ -69,10 +69,10 @@ post:
type: object
properties:
data:
$ref: '../../openapi.yaml#/components/schemas/Relation'
'401':
$ref: '../../openapi.yaml#/components/responses/UnauthorizedError'
'404':
$ref: '../../openapi.yaml#/components/responses/NotFoundError'
$ref: "../../openapi.yaml#/components/schemas/Relations"
"401":
$ref: "../../openapi.yaml#/components/responses/UnauthorizedError"
"404":
$ref: "../../openapi.yaml#/components/responses/NotFoundError"
tags:
- Relations
- Relations

View File

@@ -2,11 +2,11 @@ get:
description: Retrieve a single revision by unique identifier.
operationId: getRevision
parameters:
- $ref: '../../openapi.yaml#/components/parameters/Id'
- $ref: '../../openapi.yaml#/components/parameters/Fields'
- $ref: '../../openapi.yaml#/components/parameters/Meta'
- $ref: "../../openapi.yaml#/components/parameters/Id"
- $ref: "../../openapi.yaml#/components/parameters/Fields"
- $ref: "../../openapi.yaml#/components/parameters/Meta"
responses:
'200':
"200":
description: Successful request
content:
application/json:
@@ -14,10 +14,10 @@ get:
type: object
properties:
data:
$ref: '../../openapi.yaml#/components/schemas/Revision'
'401':
$ref: '../../openapi.yaml#/components/responses/UnauthorizedError'
'404':
$ref: '../../openapi.yaml#/components/responses/NotFoundError'
$ref: "../../openapi.yaml#/components/schemas/Revisions"
"401":
$ref: "../../openapi.yaml#/components/responses/UnauthorizedError"
"404":
$ref: "../../openapi.yaml#/components/responses/NotFoundError"
tags:
- Revisions
- Revisions

View File

@@ -2,17 +2,17 @@ get:
description: List the revisions.
operationId: getRevisions
parameters:
- $ref: '../../openapi.yaml#/components/parameters/Fields'
- $ref: '../../openapi.yaml#/components/parameters/Limit'
- $ref: '../../openapi.yaml#/components/parameters/Offset'
- $ref: '../../openapi.yaml#/components/parameters/Single'
- $ref: '../../openapi.yaml#/components/parameters/Meta'
- $ref: '../../openapi.yaml#/components/parameters/Sort'
- $ref: '../../openapi.yaml#/components/parameters/Filter'
- $ref: '../../openapi.yaml#/components/parameters/q'
- $ref: '../../openapi.yaml#/components/parameters/Page'
- $ref: "../../openapi.yaml#/components/parameters/Fields"
- $ref: "../../openapi.yaml#/components/parameters/Limit"
- $ref: "../../openapi.yaml#/components/parameters/Offset"
- $ref: "../../openapi.yaml#/components/parameters/Single"
- $ref: "../../openapi.yaml#/components/parameters/Meta"
- $ref: "../../openapi.yaml#/components/parameters/Sort"
- $ref: "../../openapi.yaml#/components/parameters/Filter"
- $ref: "../../openapi.yaml#/components/parameters/Search"
- $ref: "../../openapi.yaml#/components/parameters/Page"
responses:
'200':
"200":
description: Successful request
content:
application/json:
@@ -22,10 +22,10 @@ get:
data:
type: array
items:
$ref: '../../openapi.yaml#/components/schemas/Revision'
'401':
$ref: '../../openapi.yaml#/components/responses/UnauthorizedError'
'404':
$ref: '../../openapi.yaml#/components/responses/NotFoundError'
$ref: "../../openapi.yaml#/components/schemas/Revisions"
"401":
$ref: "../../openapi.yaml#/components/responses/UnauthorizedError"
"404":
$ref: "../../openapi.yaml#/components/responses/NotFoundError"
tags:
- Revisions
- Revisions

View File

@@ -2,10 +2,10 @@ get:
description: Retrieve a single role by unique identifier.
operationId: getRole
parameters:
- $ref: '../../openapi.yaml#/components/parameters/Fields'
- $ref: '../../openapi.yaml#/components/parameters/Meta'
- $ref: "../../openapi.yaml#/components/parameters/Fields"
- $ref: "../../openapi.yaml#/components/parameters/Meta"
responses:
'200':
"200":
description: Successful request
content:
application/json:
@@ -13,19 +13,19 @@ get:
type: object
properties:
data:
$ref: '../../openapi.yaml#/components/schemas/Role'
'401':
$ref: '../../openapi.yaml#/components/responses/UnauthorizedError'
'404':
$ref: '../../openapi.yaml#/components/responses/NotFoundError'
$ref: "../../openapi.yaml#/components/schemas/Roles"
"401":
$ref: "../../openapi.yaml#/components/responses/UnauthorizedError"
"404":
$ref: "../../openapi.yaml#/components/responses/NotFoundError"
tags:
- Roles
- Roles
patch:
description: Update an existing role
operationId: updateRole
parameters:
- $ref: '../../openapi.yaml#/components/parameters/Fields'
- $ref: '../../openapi.yaml#/components/parameters/Meta'
- $ref: "../../openapi.yaml#/components/parameters/Fields"
- $ref: "../../openapi.yaml#/components/parameters/Meta"
requestBody:
content:
application/json:
@@ -44,7 +44,8 @@ patch:
description: ID used with external services in SCIM.
type: string
ip_whitelist:
description: Array of IP addresses that are allowed to connect to the
description:
Array of IP addresses that are allowed to connect to the
API as a user of this role.
type: array
items:
@@ -57,7 +58,7 @@ patch:
type: string
type: object
responses:
'200':
"200":
description: Successful request
content:
application/json:
@@ -65,24 +66,24 @@ patch:
type: object
properties:
data:
$ref: '../../openapi.yaml#/components/schemas/Role'
'401':
$ref: '../../openapi.yaml#/components/responses/UnauthorizedError'
'404':
$ref: '../../openapi.yaml#/components/responses/NotFoundError'
$ref: "../../openapi.yaml#/components/schemas/Roles"
"401":
$ref: "../../openapi.yaml#/components/responses/UnauthorizedError"
"404":
$ref: "../../openapi.yaml#/components/responses/NotFoundError"
tags:
- Roles
- Roles
delete:
description: Delete an existing role
operationId: deleteRole
responses:
'200':
"200":
description: Successful request
'401':
$ref: '../../openapi.yaml#/components/responses/UnauthorizedError'
'404':
$ref: '../../openapi.yaml#/components/responses/NotFoundError'
"401":
$ref: "../../openapi.yaml#/components/responses/UnauthorizedError"
"404":
$ref: "../../openapi.yaml#/components/responses/NotFoundError"
tags:
- Roles
- Roles
parameters:
- $ref: '../../openapi.yaml#/components/parameters/UUId'
- $ref: "../../openapi.yaml#/components/parameters/UUId"

View File

@@ -2,17 +2,17 @@ get:
description: List the roles.
operationId: getRoles
parameters:
- $ref: '../../openapi.yaml#/components/parameters/Fields'
- $ref: '../../openapi.yaml#/components/parameters/Limit'
- $ref: '../../openapi.yaml#/components/parameters/Offset'
- $ref: '../../openapi.yaml#/components/parameters/Single'
- $ref: '../../openapi.yaml#/components/parameters/Meta'
- $ref: '../../openapi.yaml#/components/parameters/Sort'
- $ref: '../../openapi.yaml#/components/parameters/Filter'
- $ref: '../../openapi.yaml#/components/parameters/q'
- $ref: '../../openapi.yaml#/components/parameters/Page'
- $ref: "../../openapi.yaml#/components/parameters/Fields"
- $ref: "../../openapi.yaml#/components/parameters/Limit"
- $ref: "../../openapi.yaml#/components/parameters/Offset"
- $ref: "../../openapi.yaml#/components/parameters/Single"
- $ref: "../../openapi.yaml#/components/parameters/Meta"
- $ref: "../../openapi.yaml#/components/parameters/Sort"
- $ref: "../../openapi.yaml#/components/parameters/Filter"
- $ref: "../../openapi.yaml#/components/parameters/Search"
- $ref: "../../openapi.yaml#/components/parameters/Page"
responses:
'200':
"200":
description: Successful request
content:
application/json:
@@ -22,19 +22,19 @@ get:
data:
type: array
items:
$ref: '../../openapi.yaml#/components/schemas/Role'
'401':
$ref: '../../openapi.yaml#/components/responses/UnauthorizedError'
'404':
$ref: '../../openapi.yaml#/components/responses/NotFoundError'
$ref: "../../openapi.yaml#/components/schemas/Roles"
"401":
$ref: "../../openapi.yaml#/components/responses/UnauthorizedError"
"404":
$ref: "../../openapi.yaml#/components/responses/NotFoundError"
tags:
- Roles
- Roles
post:
description: Create a new role.
operationId: createRole
parameters:
- $ref: '../../openapi.yaml#/components/parameters/Fields'
- $ref: '../../openapi.yaml#/components/parameters/Meta'
- $ref: "../../openapi.yaml#/components/parameters/Fields"
- $ref: "../../openapi.yaml#/components/parameters/Meta"
requestBody:
content:
application/json:
@@ -53,7 +53,8 @@ post:
description: ID used with external services in SCIM.
type: string
ip_whitelist:
description: Array of IP addresses that are allowed to connect to the
description:
Array of IP addresses that are allowed to connect to the
API as a user of this role.
type: array
items:
@@ -67,7 +68,7 @@ post:
example: Interns
type: object
responses:
'200':
"200":
description: Successful request
content:
application/json:
@@ -75,10 +76,10 @@ post:
type: object
properties:
data:
$ref: '../../openapi.yaml#/components/schemas/Role'
'401':
$ref: '../../openapi.yaml#/components/responses/UnauthorizedError'
'404':
$ref: '../../openapi.yaml#/components/responses/NotFoundError'
$ref: "../../openapi.yaml#/components/schemas/Roles"
"401":
$ref: "../../openapi.yaml#/components/responses/UnauthorizedError"
"404":
$ref: "../../openapi.yaml#/components/responses/NotFoundError"
tags:
- Roles
- Roles

View File

@@ -1,51 +0,0 @@
get:
description: Retrieve a single SCIM Group by unique identifier.
operationId: getSCIMGroup
responses:
'200':
description: Successful request
content:
application/json:
schema:
type: object
'401':
$ref: '../../openapi.yaml#/components/responses/UnauthorizedError'
'404':
$ref: '../../openapi.yaml#/components/responses/NotFoundError'
tags:
- SCIM
patch:
description: Update an existing SCIM Group
operationId: updateSCIMGroup
requestBody:
content:
application/json:
schema:
type: object
responses:
'200':
content:
application/json:
schema:
type: object
description: Successful request
'401':
$ref: '../../openapi.yaml#/components/responses/UnauthorizedError'
'404':
$ref: '../../openapi.yaml#/components/responses/NotFoundError'
tags:
- SCIM
delete:
description: Delete an existing SCIM Group
operationId: deleteSCIMGroup
responses:
'200':
description: Successful request
'401':
$ref: '../../openapi.yaml#/components/responses/UnauthorizedError'
'404':
$ref: '../../openapi.yaml#/components/responses/NotFoundError'
tags:
- SCIM
parameters:
- $ref: '../../openapi.yaml#/components/parameters/Id'

View File

@@ -1,58 +0,0 @@
get:
description: List the SCIM Groups.
operationId: getSCIMGroups
parameters:
- description: The 1-based index of the first result in the current set of list results.
in: query
name: startIndex
required: false
schema:
type: integer
- description: Specifies the desired maximum number of query results per page.
in: query
name: count
required: false
schema:
type: integer
- description: Filter by `id`, `userName`, `emails.value` and `externalId` attributes
are supported. Only the `eq` operator is supported. Uses format `?filter=id eq
15`
in: query
name: filter
required: false
schema:
type: integer
responses:
'200':
description: Successful request
content:
application/json:
schema:
type: object
'401':
$ref: '../../openapi.yaml#/components/responses/UnauthorizedError'
'404':
$ref: '../../openapi.yaml#/components/responses/NotFoundError'
tags:
- SCIM
post:
description: Create a new SCIM Group.
operationId: createSCIMGroup
requestBody:
content:
application/json:
schema:
type: object
responses:
'200':
description: Successful request
content:
application/json:
schema:
type: object
'401':
$ref: '../../openapi.yaml#/components/responses/UnauthorizedError'
'404':
$ref: '../../openapi.yaml#/components/responses/NotFoundError'
tags:
- SCIM

View File

@@ -1,73 +0,0 @@
get:
description: Retrieve a single SCIM user by unique identifier.
operationId: getSCIMUser
parameters:
- description: The `external_id` saved in `directus_users`. Corresponds to the `id`
in the SCIM Users endpoint result.
in: path
name: id
required: true
schema:
type: integer
responses:
'200':
description: Successful request
content:
application/json:
schema:
type: object
'401':
$ref: '../../openapi.yaml#/components/responses/UnauthorizedError'
'404':
$ref: '../../openapi.yaml#/components/responses/NotFoundError'
tags:
- SCIM
patch:
description: Update an existing SCIM User
operationId: updateSCIMUser
parameters:
- description: The `external_id` saved in `directus_users`. Corresponds to the `id`
in the SCIM Users endpoint result.
in: path
name: id
required: true
schema:
type: integer
requestBody:
content:
application/json:
schema:
type: object
responses:
'200':
content:
application/json:
schema:
type: object
description: Successful request
'401':
$ref: '../../openapi.yaml#/components/responses/UnauthorizedError'
'404':
$ref: '../../openapi.yaml#/components/responses/NotFoundError'
tags:
- SCIM
delete:
description: Delete an existing SCIM User
operationId: deleteSCIMUser
parameters:
- description: The `external_id` saved in `directus_users`. Corresponds to the `id`
in the SCIM Users endpoint result.
in: path
name: id
required: true
schema:
type: integer
responses:
'200':
description: Successful request
'401':
$ref: '../../openapi.yaml#/components/responses/UnauthorizedError'
'404':
$ref: '../../openapi.yaml#/components/responses/NotFoundError'
tags:
- SCIM

View File

@@ -1,58 +0,0 @@
get:
description: List the SCIM users
operationId: getSCIMUsers
parameters:
- description: The 1-based index of the first result in the current set of list results.
in: query
name: startIndex
required: false
schema:
type: integer
- description: Specifies the desired maximum number of query results per page.
in: query
name: count
required: false
schema:
type: integer
- description: Filter by `id`, `userName`, `emails.value` and `externalId` attributes
are supported. Only the `eq` operator is supported. Uses format `?filter=id eq
15`
in: query
name: filter
required: false
schema:
type: integer
responses:
'200':
description: Successful request
content:
application/json:
schema:
type: object
'401':
$ref: '../../openapi.yaml#/components/responses/UnauthorizedError'
'404':
$ref: '../../openapi.yaml#/components/responses/NotFoundError'
tags:
- SCIM
post:
description: Create a new SCIM User.
operationId: createSCIMUser
requestBody:
content:
application/json:
schema:
type: object
responses:
'200':
content:
application/json:
schema:
type: object
description: Successful request
'401':
$ref: '../../openapi.yaml#/components/responses/UnauthorizedError'
'404':
$ref: '../../openapi.yaml#/components/responses/NotFoundError'
tags:
- SCIM

Some files were not shown because too many files have changed in this diff Show More