strapi/packages/utils/api-tests/generators.js

132 lines
2.7 KiB
JavaScript
Raw Permalink Normal View History

'use strict';
module.exports = {
article: {
2019-11-14 16:37:57 +01:00
attributes: {
title: {
type: 'string',
},
date: {
type: 'date',
},
jsonField: {
type: 'json',
},
content: {
type: 'richtext',
},
author: {
2021-07-08 18:15:32 +02:00
type: 'relation',
relation: 'manyToOne',
2021-08-11 10:05:20 +02:00
target: 'plugin::users-permissions.user',
2019-11-14 16:37:57 +01:00
targetAttribute: 'articles',
},
},
2021-08-11 10:05:20 +02:00
uid: 'api::article.article',
2021-09-13 16:57:04 +02:00
displayName: 'Article',
singularName: 'article',
pluralName: 'articles',
description: '',
collectionName: '',
},
tag: {
2019-11-14 16:37:57 +01:00
attributes: {
name: {
type: 'string',
},
articles: {
2021-07-08 18:15:32 +02:00
type: 'relation',
relation: 'manyToMany',
2021-08-11 10:05:20 +02:00
target: 'api::article.article',
2019-11-14 16:37:57 +01:00
targetAttribute: 'tags',
},
},
2021-08-11 10:05:20 +02:00
uid: 'api::tag.tag',
2021-09-13 16:57:04 +02:00
displayName: 'Tag',
singularName: 'tag',
pluralName: 'tags',
description: '',
collectionName: '',
},
category: {
2019-11-14 16:37:57 +01:00
attributes: {
name: {
type: 'string',
},
articles: {
2021-07-08 18:15:32 +02:00
type: 'relation',
relation: 'oneToMany',
2021-08-11 10:05:20 +02:00
target: 'api::article.article',
2019-11-14 16:37:57 +01:00
targetAttribute: 'category',
},
},
2021-08-11 10:05:20 +02:00
uid: 'api::category.category',
2021-09-13 16:57:04 +02:00
displayName: 'Category',
singularName: 'category',
pluralName: 'categories',
description: '',
collectionName: '',
},
reference: {
2019-11-14 16:37:57 +01:00
attributes: {
name: {
type: 'string',
},
article: {
2021-07-08 18:15:32 +02:00
type: 'relation',
relation: 'oneToOne',
2021-08-11 10:05:20 +02:00
target: 'api::article.article',
2019-11-14 16:37:57 +01:00
targetAttribute: 'reference',
},
tag: {
2021-07-08 18:15:32 +02:00
type: 'relation',
relation: 'oneToOne',
2021-08-11 10:05:20 +02:00
target: 'api::tag.tag',
2019-11-14 16:37:57 +01:00
},
},
2021-08-11 10:05:20 +02:00
uid: 'api::reference.reference',
2021-09-13 16:57:04 +02:00
displayName: 'Reference',
singularName: 'reference',
pluralName: 'references',
description: '',
2021-07-02 02:26:14 +02:00
collectionName: 'refs',
},
product: {
2019-11-14 16:37:57 +01:00
attributes: {
name: {
type: 'string',
},
description: {
type: 'richtext',
},
published: {
type: 'boolean',
},
},
2021-08-11 10:05:20 +02:00
uid: 'api::product.product',
2021-09-13 16:57:04 +02:00
displayName: 'Product',
singularName: 'product',
pluralName: 'products',
description: '',
collectionName: '',
},
2019-07-09 09:25:22 +02:00
articlewithtag: {
2019-11-14 16:37:57 +01:00
attributes: {
title: {
type: 'string',
},
tags: {
2021-07-08 18:15:32 +02:00
type: 'relation',
relation: 'oneToMany',
2021-08-11 10:05:20 +02:00
target: 'api::tag.tag',
2019-11-14 16:37:57 +01:00
},
},
2021-08-11 10:05:20 +02:00
uid: 'api::articlewit.articlewit',
2021-09-13 16:57:04 +02:00
displayName: 'Article with tag',
singularName: 'articlewithtag',
pluralName: 'articlewithtags',
2019-07-08 17:34:56 +02:00
description: '',
collectionName: '',
},
};