diff --git a/src/api/library-content/content-types/library-content/schema.json b/src/api/library-content/content-types/library-content/schema.json new file mode 100644 index 0000000..6fdf299 --- /dev/null +++ b/src/api/library-content/content-types/library-content/schema.json @@ -0,0 +1,55 @@ +{ + "kind": "collectionType", + "collectionName": "library_contents", + "info": { + "singularName": "library-content", + "pluralName": "library-contents", + "displayName": "Library Content", + "description": "" + }, + "options": { + "draftAndPublish": false + }, + "pluginOptions": {}, + "attributes": { + "slug": { + "type": "string", + "regex": "^[a-z0-9]+(?:-[a-z0-9]+)*$", + "required": true, + "unique": true + }, + "title": { + "displayName": "Library Content", + "type": "component", + "repeatable": true, + "component": "translations.library-content" + }, + "library_item": { + "type": "relation", + "relation": "manyToOne", + "target": "api::library-item.library-item", + "inversedBy": "contents" + }, + "scan_set": { + "type": "relation", + "relation": "oneToOne", + "target": "api::scan-set.scan-set", + "inversedBy": "library_content" + }, + "text_set": { + "type": "relation", + "relation": "manyToOne", + "target": "api::text-set.text-set", + "inversedBy": "library_contents" + }, + "range": { + "type": "dynamiczone", + "components": [ + "range.page-range", + "range.video-range" + ], + "required": true, + "max": 1 + } + } +} diff --git a/src/api/library-content/controllers/library-content.js b/src/api/library-content/controllers/library-content.js new file mode 100644 index 0000000..d3be1cb --- /dev/null +++ b/src/api/library-content/controllers/library-content.js @@ -0,0 +1,9 @@ +'use strict'; + +/** + * library-content controller + */ + +const { createCoreController } = require('@strapi/strapi').factories; + +module.exports = createCoreController('api::library-content.library-content'); diff --git a/src/api/library-content/routes/library-content.js b/src/api/library-content/routes/library-content.js new file mode 100644 index 0000000..d7cf5bb --- /dev/null +++ b/src/api/library-content/routes/library-content.js @@ -0,0 +1,9 @@ +'use strict'; + +/** + * library-content router. + */ + +const { createCoreRouter } = require('@strapi/strapi').factories; + +module.exports = createCoreRouter('api::library-content.library-content'); diff --git a/src/api/library-content/services/library-content.js b/src/api/library-content/services/library-content.js new file mode 100644 index 0000000..2656d73 --- /dev/null +++ b/src/api/library-content/services/library-content.js @@ -0,0 +1,9 @@ +'use strict'; + +/** + * library-content service. + */ + +const { createCoreService } = require('@strapi/strapi').factories; + +module.exports = createCoreService('api::library-content.library-content'); diff --git a/src/api/library-item/content-types/library-item/schema.json b/src/api/library-item/content-types/library-item/schema.json index 729b537..472869f 100644 --- a/src/api/library-item/content-types/library-item/schema.json +++ b/src/api/library-item/content-types/library-item/schema.json @@ -72,7 +72,8 @@ "type": "dynamiczone", "components": [ "metadata.books", - "metadata.video" + "metadata.video", + "metadata.game" ], "max": 1 }, @@ -81,6 +82,12 @@ "repeatable": false, "pluginOptions": {}, "component": "basics.size" + }, + "contents": { + "type": "relation", + "relation": "oneToMany", + "target": "api::library-content.library-content", + "mappedBy": "library_item" } } } diff --git a/src/api/scan-set/content-types/scan-set/schema.json b/src/api/scan-set/content-types/scan-set/schema.json new file mode 100644 index 0000000..2a4240c --- /dev/null +++ b/src/api/scan-set/content-types/scan-set/schema.json @@ -0,0 +1,34 @@ +{ + "kind": "collectionType", + "collectionName": "scan_sets", + "info": { + "singularName": "scan-set", + "pluralName": "scan-sets", + "displayName": "Scan Set", + "description": "" + }, + "options": { + "draftAndPublish": false + }, + "pluginOptions": {}, + "attributes": { + "slug": { + "type": "string", + "regex": "^[a-z0-9]+(?:-[a-z0-9]+)*$", + "unique": true, + "required": true + }, + "translations": { + "displayName": "Scan Set", + "type": "component", + "repeatable": true, + "component": "translations.scan-set" + }, + "library_content": { + "type": "relation", + "relation": "oneToOne", + "target": "api::library-content.library-content", + "mappedBy": "scan_set" + } + } +} diff --git a/src/api/scan-set/controllers/scan-set.js b/src/api/scan-set/controllers/scan-set.js new file mode 100644 index 0000000..af576cc --- /dev/null +++ b/src/api/scan-set/controllers/scan-set.js @@ -0,0 +1,9 @@ +'use strict'; + +/** + * scan-set controller + */ + +const { createCoreController } = require('@strapi/strapi').factories; + +module.exports = createCoreController('api::scan-set.scan-set'); diff --git a/src/api/scan-set/routes/scan-set.js b/src/api/scan-set/routes/scan-set.js new file mode 100644 index 0000000..665802f --- /dev/null +++ b/src/api/scan-set/routes/scan-set.js @@ -0,0 +1,9 @@ +'use strict'; + +/** + * scan-set router. + */ + +const { createCoreRouter } = require('@strapi/strapi').factories; + +module.exports = createCoreRouter('api::scan-set.scan-set'); diff --git a/src/api/scan-set/services/scan-set.js b/src/api/scan-set/services/scan-set.js new file mode 100644 index 0000000..1821f3f --- /dev/null +++ b/src/api/scan-set/services/scan-set.js @@ -0,0 +1,9 @@ +'use strict'; + +/** + * scan-set service. + */ + +const { createCoreService } = require('@strapi/strapi').factories; + +module.exports = createCoreService('api::scan-set.scan-set'); diff --git a/src/api/text-set/content-types/text-set/schema.json b/src/api/text-set/content-types/text-set/schema.json new file mode 100644 index 0000000..a01c5dc --- /dev/null +++ b/src/api/text-set/content-types/text-set/schema.json @@ -0,0 +1,34 @@ +{ + "kind": "collectionType", + "collectionName": "text_sets", + "info": { + "singularName": "text-set", + "pluralName": "text-sets", + "displayName": "Text Set", + "description": "" + }, + "options": { + "draftAndPublish": false + }, + "pluginOptions": {}, + "attributes": { + "slug": { + "type": "string", + "regex": "^[a-z0-9]+(?:-[a-z0-9]+)*$", + "unique": true, + "required": true + }, + "translations": { + "displayName": "Text Set", + "type": "component", + "repeatable": true, + "component": "translations.text-set" + }, + "library_contents": { + "type": "relation", + "relation": "oneToMany", + "target": "api::library-content.library-content", + "mappedBy": "text_set" + } + } +} diff --git a/src/api/text-set/controllers/text-set.js b/src/api/text-set/controllers/text-set.js new file mode 100644 index 0000000..587d419 --- /dev/null +++ b/src/api/text-set/controllers/text-set.js @@ -0,0 +1,9 @@ +'use strict'; + +/** + * text-set controller + */ + +const { createCoreController } = require('@strapi/strapi').factories; + +module.exports = createCoreController('api::text-set.text-set'); diff --git a/src/api/text-set/routes/text-set.js b/src/api/text-set/routes/text-set.js new file mode 100644 index 0000000..7749d39 --- /dev/null +++ b/src/api/text-set/routes/text-set.js @@ -0,0 +1,9 @@ +'use strict'; + +/** + * text-set router. + */ + +const { createCoreRouter } = require('@strapi/strapi').factories; + +module.exports = createCoreRouter('api::text-set.text-set'); diff --git a/src/api/text-set/services/text-set.js b/src/api/text-set/services/text-set.js new file mode 100644 index 0000000..6f1aca8 --- /dev/null +++ b/src/api/text-set/services/text-set.js @@ -0,0 +1,9 @@ +'use strict'; + +/** + * text-set service. + */ + +const { createCoreService } = require('@strapi/strapi').factories; + +module.exports = createCoreService('api::text-set.text-set'); diff --git a/src/components/basics/source.json b/src/components/basics/source.json new file mode 100644 index 0000000..4d343ff --- /dev/null +++ b/src/components/basics/source.json @@ -0,0 +1,46 @@ +{ + "collectionName": "components_basics_sources", + "info": { + "displayName": "Source", + "icon": "book-reader", + "description": "" + }, + "options": {}, + "attributes": { + "scanners": { + "type": "relation", + "relation": "oneToMany", + "target": "api::recorder.recorder" + }, + "cleaners": { + "type": "relation", + "relation": "oneToMany", + "target": "api::recorder.recorder" + }, + "transcribers": { + "type": "relation", + "relation": "oneToMany", + "target": "api::recorder.recorder" + }, + "translators": { + "type": "relation", + "relation": "oneToMany", + "target": "api::recorder.recorder" + }, + "proofreaders": { + "type": "relation", + "relation": "oneToMany", + "target": "api::recorder.recorder" + }, + "typesetters": { + "type": "relation", + "relation": "oneToMany", + "target": "api::recorder.recorder" + }, + "source_language": { + "type": "relation", + "relation": "oneToOne", + "target": "api::language.language" + } + } +} diff --git a/src/components/metadata/game.json b/src/components/metadata/game.json new file mode 100644 index 0000000..a492e24 --- /dev/null +++ b/src/components/metadata/game.json @@ -0,0 +1,15 @@ +{ + "collectionName": "components_metadata_games", + "info": { + "displayName": "Game", + "icon": "gamepad" + }, + "options": {}, + "attributes": { + "game_platform": { + "type": "relation", + "relation": "oneToOne", + "target": "api::game-platform.game-platform" + } + } +} diff --git a/src/components/range/page-range.json b/src/components/range/page-range.json new file mode 100644 index 0000000..b85d83a --- /dev/null +++ b/src/components/range/page-range.json @@ -0,0 +1,18 @@ +{ + "collectionName": "components_range_page_ranges", + "info": { + "displayName": "Page Range", + "icon": "book-medical" + }, + "options": {}, + "attributes": { + "starting_page": { + "type": "integer", + "min": 1 + }, + "ending_page": { + "type": "integer", + "min": 1 + } + } +} diff --git a/src/components/range/video-range.json b/src/components/range/video-range.json new file mode 100644 index 0000000..2c22007 --- /dev/null +++ b/src/components/range/video-range.json @@ -0,0 +1,16 @@ +{ + "collectionName": "components_range_video_ranges", + "info": { + "displayName": "Video Range", + "icon": "file-video" + }, + "options": {}, + "attributes": { + "starting_time": { + "type": "time" + }, + "ending_time": { + "type": "time" + } + } +} diff --git a/src/components/translations/library-content.json b/src/components/translations/library-content.json new file mode 100644 index 0000000..02bb682 --- /dev/null +++ b/src/components/translations/library-content.json @@ -0,0 +1,18 @@ +{ + "collectionName": "components_translations_library_contents", + "info": { + "displayName": "Library Content", + "icon": "torah" + }, + "options": {}, + "attributes": { + "title": { + "type": "string" + }, + "language": { + "type": "relation", + "relation": "oneToOne", + "target": "api::language.language" + } + } +} diff --git a/src/components/translations/scan-set.json b/src/components/translations/scan-set.json new file mode 100644 index 0000000..9bd578d --- /dev/null +++ b/src/components/translations/scan-set.json @@ -0,0 +1,31 @@ +{ + "collectionName": "components_translations_scan_sets", + "info": { + "displayName": "Scan Set", + "icon": "book-open", + "description": "" + }, + "options": {}, + "attributes": { + "language": { + "type": "relation", + "relation": "oneToOne", + "target": "api::language.language" + }, + "pages": { + "type": "media", + "multiple": true, + "required": false, + "allowedTypes": [ + "images" + ] + }, + "source": { + "displayName": "Source", + "type": "component", + "repeatable": false, + "component": "basics.source", + "required": true + } + } +} diff --git a/src/components/translations/text-set.json b/src/components/translations/text-set.json new file mode 100644 index 0000000..112a14f --- /dev/null +++ b/src/components/translations/text-set.json @@ -0,0 +1,25 @@ +{ + "collectionName": "components_translations_text_sets", + "info": { + "displayName": "Text Set", + "icon": "align-center", + "description": "" + }, + "options": {}, + "attributes": { + "text": { + "type": "richtext" + }, + "source": { + "type": "component", + "repeatable": false, + "component": "basics.source", + "required": true + }, + "language": { + "type": "relation", + "relation": "oneToOne", + "target": "api::language.language" + } + } +}