mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
* lint @typescript-eslint/recommended * lint @typescript-eslint/recommended-requiring-type-checking fix type not detected locally due to wierd uuid typings missing save error not reported locally --------- Co-authored-by: Wolfgang Huß <wolle.huss@pjannto.com>
74 lines
2.4 KiB
TypeScript
74 lines
2.4 KiB
TypeScript
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
|
import { v4 as uuid } from 'uuid'
|
|
|
|
export default {
|
|
id: { type: 'string', primary: true, default: uuid },
|
|
activityId: { type: 'string', allow: [null] },
|
|
objectId: { type: 'string', allow: [null] },
|
|
image: {
|
|
type: 'relationship',
|
|
relationship: 'HERO_IMAGE',
|
|
target: 'Image',
|
|
direction: 'out',
|
|
},
|
|
author: {
|
|
type: 'relationship',
|
|
relationship: 'WROTE',
|
|
target: 'User',
|
|
direction: 'in',
|
|
},
|
|
title: { type: 'string', disallow: [null], min: 3 },
|
|
slug: { type: 'string', allow: [null], unique: 'true' },
|
|
content: { type: 'string', disallow: [null], min: 3 },
|
|
contentExcerpt: { type: 'string', allow: [null] },
|
|
deleted: { type: 'boolean', default: false },
|
|
disabled: { type: 'boolean', default: false },
|
|
clickedCount: { type: 'int', default: 0 },
|
|
viewedTeaserCount: { type: 'int', default: 0 },
|
|
notified: {
|
|
type: 'relationship',
|
|
relationship: 'NOTIFIED',
|
|
target: 'User',
|
|
direction: 'out',
|
|
properties: {
|
|
read: { type: 'boolean', default: false },
|
|
reason: {
|
|
type: 'string',
|
|
valid: ['mentioned_in_post', 'mentioned_in_comment', 'commented_on_post'],
|
|
},
|
|
createdAt: { type: 'string', isoDate: true, default: () => new Date().toISOString() },
|
|
},
|
|
},
|
|
createdAt: { type: 'string', isoDate: true, default: () => new Date().toISOString() },
|
|
updatedAt: {
|
|
type: 'string',
|
|
isoDate: true,
|
|
required: true,
|
|
default: () => new Date().toISOString(),
|
|
},
|
|
language: { type: 'string', allow: [null] },
|
|
comments: {
|
|
type: 'relationship',
|
|
relationship: 'COMMENTS',
|
|
target: 'Comment',
|
|
direction: 'in',
|
|
properties: {
|
|
createdAt: { type: 'string', isoDate: true, default: () => new Date().toISOString() },
|
|
updatedAt: { type: 'string', isoDate: true, default: () => new Date().toISOString() },
|
|
},
|
|
},
|
|
pinned: { type: 'boolean', default: null, valid: [null, true] },
|
|
postType: { type: 'string', default: 'Article', valid: ['Article', 'Event'] },
|
|
observes: {
|
|
type: 'relationship',
|
|
relationship: 'OBSERVES',
|
|
target: 'User',
|
|
direction: 'in',
|
|
properties: {
|
|
createdAt: { type: 'string', isoDate: true, default: () => new Date().toISOString() },
|
|
updatedAt: { type: 'string', isoDate: true, default: () => new Date().toISOString() },
|
|
active: { type: 'boolean', default: true },
|
|
},
|
|
},
|
|
}
|