strapi/test/helpers/generators.js

120 lines
2.3 KiB
JavaScript
Raw 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',
name: 'article',
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',
name: 'tag',
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',
name: 'category',
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',
name: 'reference',
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',
name: 'product',
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',
2019-07-09 09:25:22 +02:00
name: 'articlewithtag',
2019-07-08 17:34:56 +02:00
description: '',
collectionName: '',
},
};