From 0bf3c0096edfd65b139355ca375d2f3f57e93520 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20FAMIBELLE-PRONZOLA?= Date: Sat, 21 May 2022 11:47:15 +0400 Subject: [PATCH] Remove old api folder --- api/.gitkeep | 0 api/awtis/config/routes.json | 52 - api/awtis/controllers/awtis.js | 41 - api/awtis/documentation/1.0.0/awtis.json | 799 ------------- .../documentation/1.0.0/overrides/awtis.json | 20 - api/awtis/services/awtis.js | 8 - api/email/services/email.js | 24 - api/komante/config/routes.json | 52 - api/komante/controllers/komante.js | 70 -- api/komante/documentation/1.0.0/komante.json | 701 ------------ api/komante/services/komante.js | 8 - api/slugs/config/routes.json | 12 - api/slugs/controllers/slugs.js | 12 - api/slugs/documentation/1.0.0/slugs.json | 66 -- api/teks/config/routes.json | 52 - api/teks/controllers/teks.js | 51 - .../documentation/1.0.0/overrides/teks.json | 20 - api/teks/documentation/1.0.0/teks.json | 1012 ----------------- api/teks/services/teks.js | 8 - api/translator/services/translator.js | 39 - 20 files changed, 3047 deletions(-) delete mode 100644 api/.gitkeep delete mode 100644 api/awtis/config/routes.json delete mode 100644 api/awtis/controllers/awtis.js delete mode 100644 api/awtis/documentation/1.0.0/awtis.json delete mode 100644 api/awtis/documentation/1.0.0/overrides/awtis.json delete mode 100644 api/awtis/services/awtis.js delete mode 100644 api/email/services/email.js delete mode 100644 api/komante/config/routes.json delete mode 100644 api/komante/controllers/komante.js delete mode 100644 api/komante/documentation/1.0.0/komante.json delete mode 100644 api/komante/services/komante.js delete mode 100644 api/slugs/config/routes.json delete mode 100644 api/slugs/controllers/slugs.js delete mode 100644 api/slugs/documentation/1.0.0/slugs.json delete mode 100644 api/teks/config/routes.json delete mode 100644 api/teks/controllers/teks.js delete mode 100644 api/teks/documentation/1.0.0/overrides/teks.json delete mode 100644 api/teks/documentation/1.0.0/teks.json delete mode 100644 api/teks/services/teks.js delete mode 100644 api/translator/services/translator.js diff --git a/api/.gitkeep b/api/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/api/awtis/config/routes.json b/api/awtis/config/routes.json deleted file mode 100644 index f941bd0..0000000 --- a/api/awtis/config/routes.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "routes": [ - { - "method": "GET", - "path": "/awtis", - "handler": "awtis.find", - "config": { - "policies": [] - } - }, - { - "method": "GET", - "path": "/awtis/count", - "handler": "awtis.count", - "config": { - "policies": [] - } - }, - { - "method": "GET", - "path": "/awtis/:id", - "handler": "awtis.findOne", - "config": { - "policies": [] - } - }, - { - "method": "POST", - "path": "/awtis", - "handler": "awtis.create", - "config": { - "policies": [] - } - }, - { - "method": "PUT", - "path": "/awtis/:id", - "handler": "awtis.update", - "config": { - "policies": [] - } - }, - { - "method": "DELETE", - "path": "/awtis/:id", - "handler": "awtis.delete", - "config": { - "policies": [] - } - } - ] -} diff --git a/api/awtis/controllers/awtis.js b/api/awtis/controllers/awtis.js deleted file mode 100644 index 2cbbeed..0000000 --- a/api/awtis/controllers/awtis.js +++ /dev/null @@ -1,41 +0,0 @@ -'use strict'; - -const {default: createStrapi} = require('strapi'); -const {parseMultipartData, sanitizeEntity} = require('strapi-utils') - -/** - * Read the documentation (https://strapi.io/documentation/v3.x/concepts/controllers.html#core-controllers) - * to customize this controller - */ - -const searchAwtis = async alias => { - const awtis = await strapi.query('awtis').findOne({alias: alias.trim()}) - return awtis -} - -module.exports = { - async create(ctx) { - let entity - if (ctx.is('multipart')) { - let {data} = parseMultipartData(ctx) - const awtis = await searchAwtis(data.alias) - if (awtis) { - entity = await strapi.services.awtis.update({id: awtis.id}, awtis) - } else { - data.published_at = null - entity = await createStrapi.services.awtis.create(data) - } - } else { - let {body} = ctx.request - const awtis = await searchAwtis(body.alias) - if (awtis) { - entity = await strapi.services.awtis.update({id: awtis.id}, awtis) - } else { - body.published_at = null - entity = await strapi.services.awtis.create(body) - } - } - - return sanitizeEntity(entity, {model: strapi.models.awtis}) - } -} diff --git a/api/awtis/documentation/1.0.0/awtis.json b/api/awtis/documentation/1.0.0/awtis.json deleted file mode 100644 index 067873d..0000000 --- a/api/awtis/documentation/1.0.0/awtis.json +++ /dev/null @@ -1,799 +0,0 @@ -{ - "paths": { - "/awtis": { - "get": { - "deprecated": false, - "description": "Find all the awtis's records", - "responses": { - "200": { - "description": "Retrieve awtis document(s)", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Awtis" - } - } - } - } - }, - "403": { - "description": "Forbidden", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - }, - "404": { - "description": "Not found", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - }, - "default": { - "description": "unexpected error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - } - }, - "summary": "", - "tags": [ - "Awtis" - ], - "parameters": [ - { - "name": "_limit", - "in": "query", - "required": false, - "description": "Maximum number of results possible", - "schema": { - "type": "integer" - }, - "deprecated": false - }, - { - "name": "_sort", - "in": "query", - "required": false, - "description": "Sort according to a specific field.", - "schema": { - "type": "string" - }, - "deprecated": false - }, - { - "name": "_start", - "in": "query", - "required": false, - "description": "Skip a specific number of entries (especially useful for pagination)", - "schema": { - "type": "integer" - }, - "deprecated": false - }, - { - "name": "=", - "in": "query", - "required": false, - "description": "Get entries that matches exactly your input", - "schema": { - "type": "string" - }, - "deprecated": false - }, - { - "name": "_ne", - "in": "query", - "required": false, - "description": "Get records that are not equals to something", - "schema": { - "type": "string" - }, - "deprecated": false - }, - { - "name": "_lt", - "in": "query", - "required": false, - "description": "Get record that are lower than a value", - "schema": { - "type": "string" - }, - "deprecated": false - }, - { - "name": "_lte", - "in": "query", - "required": false, - "description": "Get records that are lower than or equal to a value", - "schema": { - "type": "string" - }, - "deprecated": false - }, - { - "name": "_gt", - "in": "query", - "required": false, - "description": "Get records that are greater than a value", - "schema": { - "type": "string" - }, - "deprecated": false - }, - { - "name": "_gte", - "in": "query", - "required": false, - "description": "Get records that are greater than or equal a value", - "schema": { - "type": "string" - }, - "deprecated": false - }, - { - "name": "_contains", - "in": "query", - "required": false, - "description": "Get records that contains a value", - "schema": { - "type": "string" - }, - "deprecated": false - }, - { - "name": "_containss", - "in": "query", - "required": false, - "description": "Get records that contains (case sensitive) a value", - "schema": { - "type": "string" - }, - "deprecated": false - }, - { - "name": "_in", - "in": "query", - "required": false, - "description": "Get records that matches any value in the array of values", - "schema": { - "type": "array", - "items": { - "type": "string" - } - }, - "deprecated": false - }, - { - "name": "_nin", - "in": "query", - "required": false, - "description": "Get records that doesn't match any value in the array of values", - "schema": { - "type": "array", - "items": { - "type": "string" - } - }, - "deprecated": false - } - ] - }, - "post": { - "deprecated": false, - "description": "Create a new awtis record", - "responses": { - "200": { - "description": "Retrieve awtis document(s)", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Awtis" - } - } - } - }, - "403": { - "description": "Forbidden", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - }, - "404": { - "description": "Not found", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - }, - "default": { - "description": "unexpected error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - } - }, - "summary": "", - "tags": [ - "Awtis" - ], - "requestBody": { - "description": "", - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NewAwtis" - } - } - } - } - } - }, - "/awtis/count": { - "get": { - "deprecated": false, - "description": "Retrieve the number of awtis documents", - "responses": { - "200": { - "description": "Retrieve awtis document(s)", - "content": { - "application/json": { - "schema": { - "properties": { - "count": { - "type": "integer" - } - } - } - } - } - }, - "403": { - "description": "Forbidden", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - }, - "404": { - "description": "Not found", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - }, - "default": { - "description": "unexpected error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - } - }, - "summary": "", - "tags": [ - "Awtis" - ], - "parameters": [] - } - }, - "/awtis/{id}": { - "get": { - "deprecated": false, - "description": "Find one awtis record", - "responses": { - "200": { - "description": "Retrieve awtis document(s)", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Awtis" - } - } - } - }, - "403": { - "description": "Forbidden", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - }, - "404": { - "description": "Not found", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - }, - "default": { - "description": "unexpected error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - } - }, - "summary": "", - "tags": [ - "Awtis" - ], - "parameters": [ - { - "name": "id", - "in": "path", - "description": "", - "deprecated": false, - "required": true, - "schema": { - "type": "string" - } - } - ] - }, - "put": { - "deprecated": false, - "description": "Update a single awtis record", - "responses": { - "200": { - "description": "Retrieve awtis document(s)", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Awtis" - } - } - } - }, - "403": { - "description": "Forbidden", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - }, - "404": { - "description": "Not found", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - }, - "default": { - "description": "unexpected error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - } - }, - "summary": "", - "tags": [ - "Awtis" - ], - "requestBody": { - "description": "", - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NewAwtis" - } - } - } - }, - "parameters": [ - { - "name": "id", - "in": "path", - "description": "", - "deprecated": false, - "required": true, - "schema": { - "type": "string" - } - } - ] - }, - "delete": { - "deprecated": false, - "description": "Delete a single awtis record", - "responses": { - "200": { - "description": "deletes a single awtis based on the ID supplied", - "content": { - "application/json": { - "schema": { - "type": "integer", - "format": "int64" - } - } - } - }, - "403": { - "description": "Forbidden", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - }, - "404": { - "description": "Not found", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - }, - "default": { - "description": "unexpected error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - } - }, - "summary": "", - "tags": [ - "Awtis" - ], - "parameters": [ - { - "name": "id", - "in": "path", - "description": "", - "deprecated": false, - "required": true, - "schema": { - "type": "string" - } - } - ] - } - } - }, - "components": { - "schemas": { - "Awtis": { - "required": [ - "id", - "alias" - ], - "properties": { - "id": { - "type": "string" - }, - "alias": { - "type": "string" - }, - "prenon": { - "type": "string" - }, - "non": { - "type": "string" - }, - "biyografi": { - "type": "string" - }, - "nesans": { - "type": "string", - "format": "date" - }, - "foto": { - "type": "array", - "items": { - "required": [ - "id", - "name", - "hash", - "mime", - "size", - "url", - "provider" - ], - "properties": { - "id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "alternativeText": { - "type": "string" - }, - "caption": { - "type": "string" - }, - "width": { - "type": "integer" - }, - "height": { - "type": "integer" - }, - "formats": { - "type": "object" - }, - "hash": { - "type": "string" - }, - "ext": { - "type": "string" - }, - "mime": { - "type": "string" - }, - "size": { - "type": "number" - }, - "url": { - "type": "string" - }, - "previewUrl": { - "type": "string" - }, - "provider": { - "type": "string" - }, - "provider_metadata": { - "type": "object" - }, - "related": { - "type": "string" - }, - "created_by": { - "type": "string" - }, - "updated_by": { - "type": "string" - } - } - } - }, - "teks": { - "type": "array", - "items": { - "required": [ - "id", - "tit", - "transkripsyon" - ], - "properties": { - "id": { - "type": "string" - }, - "tit": { - "type": "string" - }, - "transkripsyon": { - "type": "string" - }, - "tradiksyon": { - "type": "component" - }, - "lanne": { - "type": "integer" - }, - "lyen": { - "type": "component" - }, - "awtis": { - "type": "array", - "items": { - "type": "string" - } - }, - "kouteyAchtey": { - "type": "component" - }, - "slug": { - "type": "string" - }, - "kouveti": { - "type": "string" - }, - "okiMizikID": { - "type": "integer" - }, - "user": { - "type": "string" - }, - "eksplisit": { - "type": "boolean" - }, - "komante": { - "type": "array", - "items": { - "type": "string" - } - }, - "forceSlug": { - "type": "boolean" - }, - "tradiksyonOtomatik": { - "type": "boolean" - }, - "userAdmin": { - "type": "string" - }, - "published_at": { - "type": "string" - }, - "created_by": { - "type": "string" - }, - "updated_by": { - "type": "string" - } - } - } - }, - "user": { - "required": [ - "id", - "username", - "email" - ], - "properties": { - "id": { - "type": "string" - }, - "username": { - "type": "string" - }, - "email": { - "type": "string" - }, - "provider": { - "type": "string" - }, - "password": { - "type": "string" - }, - "resetPasswordToken": { - "type": "string" - }, - "confirmationToken": { - "type": "string" - }, - "confirmed": { - "type": "boolean" - }, - "blocked": { - "type": "boolean" - }, - "role": { - "type": "string" - }, - "canAutoTranslate": { - "type": "boolean" - }, - "created_by": { - "type": "string" - }, - "updated_by": { - "type": "string" - } - } - }, - "slug": { - "type": "string" - }, - "published_at": { - "type": "string", - "format": "date-time" - } - } - }, - "NewAwtis": { - "required": [ - "alias" - ], - "properties": { - "alias": { - "type": "string" - }, - "prenon": { - "type": "string" - }, - "non": { - "type": "string" - }, - "biyografi": { - "type": "string" - }, - "nesans": { - "type": "string", - "format": "date" - }, - "teks": { - "type": "array", - "items": { - "type": "string" - } - }, - "user": { - "type": "string" - }, - "slug": { - "type": "string" - }, - "published_at": { - "type": "string", - "format": "date-time" - }, - "created_by": { - "type": "string" - }, - "updated_by": { - "type": "string" - } - } - } - } - }, - "tags": [ - { - "name": "Awtis" - } - ] -} \ No newline at end of file diff --git a/api/awtis/documentation/1.0.0/overrides/awtis.json b/api/awtis/documentation/1.0.0/overrides/awtis.json deleted file mode 100644 index 9414bc7..0000000 --- a/api/awtis/documentation/1.0.0/overrides/awtis.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "paths": { - "/awtis": { - "get": { - "parameters": [] - }, - "post": { - "deprecated": true - } - }, - "/awtis/{id}" : { - "put": { - "deprecated": true - }, - "delete": { - "deprecated": true - } - } - } -} diff --git a/api/awtis/services/awtis.js b/api/awtis/services/awtis.js deleted file mode 100644 index 1f5330e..0000000 --- a/api/awtis/services/awtis.js +++ /dev/null @@ -1,8 +0,0 @@ -'use strict'; - -/** - * Read the documentation (https://strapi.io/documentation/v3.x/concepts/services.html#core-services) - * to customize this service - */ - -module.exports = {}; diff --git a/api/email/services/email.js b/api/email/services/email.js deleted file mode 100644 index 5975028..0000000 --- a/api/email/services/email.js +++ /dev/null @@ -1,24 +0,0 @@ -const nodemailer = require('nodemailer') - -const transporter = nodemailer.createTransport({ - host: process.env.SMTP_HOST, - port: process.env.SMTP_PORT, - secure: false, - auth: { - user: process.env.SMTP_USERNAME, - pass: process.env.SMTP_PASSWORD - } -}) - -module.exports = { - send: (from, to, subject, text) => { - const options = { - from, - to, - subject, - text, - } - - return transporter.sendMail(options) - } -} diff --git a/api/komante/config/routes.json b/api/komante/config/routes.json deleted file mode 100644 index 59124ee..0000000 --- a/api/komante/config/routes.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "routes": [ - { - "method": "GET", - "path": "/komante", - "handler": "komante.find", - "config": { - "policies": [] - } - }, - { - "method": "GET", - "path": "/komante/count", - "handler": "komante.count", - "config": { - "policies": [] - } - }, - { - "method": "GET", - "path": "/komante/:id", - "handler": "komante.findOne", - "config": { - "policies": [] - } - }, - { - "method": "POST", - "path": "/komante", - "handler": "komante.create", - "config": { - "policies": [] - } - }, - { - "method": "PUT", - "path": "/komante/:id", - "handler": "komante.update", - "config": { - "policies": [] - } - }, - { - "method": "DELETE", - "path": "/komante/:id", - "handler": "komante.delete", - "config": { - "policies": [] - } - } - ] -} diff --git a/api/komante/controllers/komante.js b/api/komante/controllers/komante.js deleted file mode 100644 index 0d1e990..0000000 --- a/api/komante/controllers/komante.js +++ /dev/null @@ -1,70 +0,0 @@ -'use strict'; - -const {default: createStrapi} = require('strapi'); -const {parseMultipartData, sanitizeEntity} = require('strapi-utils') - -const findUser = async userId => { - const user = await strapi.query('user', 'users-permissions').findOne({id: userId}) - return user -} - -module.exports = { - async create(ctx) { - let entity - if (ctx.is('multipart')) { - let {data} = parseMultipartData(ctx) - data.sentAt = new Date() - data.published_at = null - entity = await createStrapi.services.komante.create(data) - } else { - let {body} = ctx.request - body.sentAt = new Date() - body.published_at = null - entity = await strapi.services.komante.create(body) - } - - return sanitizeEntity(entity, {model: strapi.models.komante}) - }, - async find(ctx) { - let entities - if (ctx.query._q) { - entities = await strapi.services.komante.search(ctx.query, []) - for (const entity of entities) { - const user = await findUser(entity.user) - - if (!user) { - throw strapi.errors.badRequest('Not found') - } - - entity.username = user.username - } - } else { - entities = await strapi.services.komante.find(ctx.query, []) - for (const entity of entities) { - const user = await findUser(entity.user) - - if (!user) { - throw strapi.errors.badRequest('Not found') - } - - entity.username = user.username - } - } - - return entities.map(entity => sanitizeEntity(entity, {model: strapi.models.komante})); - }, - async findOne(ctx) { - const {id} = ctx.params - - const entity = await strapi.services.komante.findOne({id}, []) - const user = await findUser(entity.user) - - if (!user) { - throw strapi.errors.badRequest('Not found') - } - - entity.username = user.username - - return sanitizeEntity(entity, {model: strapi.models.komante}) - }, -} diff --git a/api/komante/documentation/1.0.0/komante.json b/api/komante/documentation/1.0.0/komante.json deleted file mode 100644 index 6638bfd..0000000 --- a/api/komante/documentation/1.0.0/komante.json +++ /dev/null @@ -1,701 +0,0 @@ -{ - "paths": { - "/komante": { - "get": { - "deprecated": false, - "description": "Find all the komante's records", - "responses": { - "200": { - "description": "Retrieve komante document(s)", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Komante" - } - } - } - } - }, - "403": { - "description": "Forbidden", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - }, - "404": { - "description": "Not found", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - }, - "default": { - "description": "unexpected error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - } - }, - "summary": "", - "tags": [ - "Komante" - ], - "parameters": [ - { - "name": "_limit", - "in": "query", - "required": false, - "description": "Maximum number of results possible", - "schema": { - "type": "integer" - }, - "deprecated": false - }, - { - "name": "_sort", - "in": "query", - "required": false, - "description": "Sort according to a specific field.", - "schema": { - "type": "string" - }, - "deprecated": false - }, - { - "name": "_start", - "in": "query", - "required": false, - "description": "Skip a specific number of entries (especially useful for pagination)", - "schema": { - "type": "integer" - }, - "deprecated": false - }, - { - "name": "=", - "in": "query", - "required": false, - "description": "Get entries that matches exactly your input", - "schema": { - "type": "string" - }, - "deprecated": false - }, - { - "name": "_ne", - "in": "query", - "required": false, - "description": "Get records that are not equals to something", - "schema": { - "type": "string" - }, - "deprecated": false - }, - { - "name": "_lt", - "in": "query", - "required": false, - "description": "Get record that are lower than a value", - "schema": { - "type": "string" - }, - "deprecated": false - }, - { - "name": "_lte", - "in": "query", - "required": false, - "description": "Get records that are lower than or equal to a value", - "schema": { - "type": "string" - }, - "deprecated": false - }, - { - "name": "_gt", - "in": "query", - "required": false, - "description": "Get records that are greater than a value", - "schema": { - "type": "string" - }, - "deprecated": false - }, - { - "name": "_gte", - "in": "query", - "required": false, - "description": "Get records that are greater than or equal a value", - "schema": { - "type": "string" - }, - "deprecated": false - }, - { - "name": "_contains", - "in": "query", - "required": false, - "description": "Get records that contains a value", - "schema": { - "type": "string" - }, - "deprecated": false - }, - { - "name": "_containss", - "in": "query", - "required": false, - "description": "Get records that contains (case sensitive) a value", - "schema": { - "type": "string" - }, - "deprecated": false - }, - { - "name": "_in", - "in": "query", - "required": false, - "description": "Get records that matches any value in the array of values", - "schema": { - "type": "array", - "items": { - "type": "string" - } - }, - "deprecated": false - }, - { - "name": "_nin", - "in": "query", - "required": false, - "description": "Get records that doesn't match any value in the array of values", - "schema": { - "type": "array", - "items": { - "type": "string" - } - }, - "deprecated": false - } - ] - }, - "post": { - "deprecated": false, - "description": "Create a new komante record", - "responses": { - "200": { - "description": "Retrieve komante document(s)", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Komante" - } - } - } - }, - "403": { - "description": "Forbidden", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - }, - "404": { - "description": "Not found", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - }, - "default": { - "description": "unexpected error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - } - }, - "summary": "", - "tags": [ - "Komante" - ], - "requestBody": { - "description": "", - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NewKomante" - } - } - } - } - } - }, - "/komante/count": { - "get": { - "deprecated": false, - "description": "Retrieve the number of komante documents", - "responses": { - "200": { - "description": "Retrieve komante document(s)", - "content": { - "application/json": { - "schema": { - "properties": { - "count": { - "type": "integer" - } - } - } - } - } - }, - "403": { - "description": "Forbidden", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - }, - "404": { - "description": "Not found", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - }, - "default": { - "description": "unexpected error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - } - }, - "summary": "", - "tags": [ - "Komante" - ], - "parameters": [] - } - }, - "/komante/{id}": { - "get": { - "deprecated": false, - "description": "Find one komante record", - "responses": { - "200": { - "description": "Retrieve komante document(s)", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Komante" - } - } - } - }, - "403": { - "description": "Forbidden", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - }, - "404": { - "description": "Not found", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - }, - "default": { - "description": "unexpected error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - } - }, - "summary": "", - "tags": [ - "Komante" - ], - "parameters": [ - { - "name": "id", - "in": "path", - "description": "", - "deprecated": false, - "required": true, - "schema": { - "type": "string" - } - } - ] - }, - "put": { - "deprecated": false, - "description": "Update a single komante record", - "responses": { - "200": { - "description": "Retrieve komante document(s)", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Komante" - } - } - } - }, - "403": { - "description": "Forbidden", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - }, - "404": { - "description": "Not found", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - }, - "default": { - "description": "unexpected error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - } - }, - "summary": "", - "tags": [ - "Komante" - ], - "requestBody": { - "description": "", - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NewKomante" - } - } - } - }, - "parameters": [ - { - "name": "id", - "in": "path", - "description": "", - "deprecated": false, - "required": true, - "schema": { - "type": "string" - } - } - ] - }, - "delete": { - "deprecated": false, - "description": "Delete a single komante record", - "responses": { - "200": { - "description": "deletes a single komante based on the ID supplied", - "content": { - "application/json": { - "schema": { - "type": "integer", - "format": "int64" - } - } - } - }, - "403": { - "description": "Forbidden", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - }, - "404": { - "description": "Not found", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - }, - "default": { - "description": "unexpected error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - } - }, - "summary": "", - "tags": [ - "Komante" - ], - "parameters": [ - { - "name": "id", - "in": "path", - "description": "", - "deprecated": false, - "required": true, - "schema": { - "type": "string" - } - } - ] - } - } - }, - "components": { - "schemas": { - "Komante": { - "required": [ - "id", - "kontni", - "sentAt" - ], - "properties": { - "id": { - "type": "string" - }, - "kontni": { - "type": "string" - }, - "user": { - "required": [ - "id", - "username", - "email" - ], - "properties": { - "id": { - "type": "string" - }, - "username": { - "type": "string" - }, - "email": { - "type": "string" - }, - "provider": { - "type": "string" - }, - "password": { - "type": "string" - }, - "resetPasswordToken": { - "type": "string" - }, - "confirmationToken": { - "type": "string" - }, - "confirmed": { - "type": "boolean" - }, - "blocked": { - "type": "boolean" - }, - "role": { - "type": "string" - }, - "canAutoTranslate": { - "type": "boolean" - }, - "created_by": { - "type": "string" - }, - "updated_by": { - "type": "string" - } - } - }, - "teks": { - "required": [ - "id", - "tit", - "transkripsyon" - ], - "properties": { - "id": { - "type": "string" - }, - "tit": { - "type": "string" - }, - "transkripsyon": { - "type": "string" - }, - "tradiksyon": { - "type": "component" - }, - "lanne": { - "type": "integer" - }, - "lyen": { - "type": "component" - }, - "awtis": { - "type": "array", - "items": { - "type": "string" - } - }, - "kouteyAchtey": { - "type": "component" - }, - "slug": { - "type": "string" - }, - "kouveti": { - "type": "string" - }, - "okiMizikID": { - "type": "integer" - }, - "user": { - "type": "string" - }, - "eksplisit": { - "type": "boolean" - }, - "komante": { - "type": "array", - "items": { - "type": "string" - } - }, - "forceSlug": { - "type": "boolean" - }, - "tradiksyonOtomatik": { - "type": "boolean" - }, - "userAdmin": { - "type": "string" - }, - "published_at": { - "type": "string" - }, - "created_by": { - "type": "string" - }, - "updated_by": { - "type": "string" - } - } - }, - "sentAt": { - "type": "string", - "format": "date-time" - }, - "published_at": { - "type": "string", - "format": "date-time" - } - } - }, - "NewKomante": { - "required": [ - "kontni", - "sentAt" - ], - "properties": { - "kontni": { - "type": "string" - }, - "user": { - "type": "string" - }, - "teks": { - "type": "string" - }, - "sentAt": { - "type": "string", - "format": "date-time" - }, - "published_at": { - "type": "string", - "format": "date-time" - }, - "created_by": { - "type": "string" - }, - "updated_by": { - "type": "string" - } - } - } - } - }, - "tags": [ - { - "name": "Komante" - } - ] -} \ No newline at end of file diff --git a/api/komante/services/komante.js b/api/komante/services/komante.js deleted file mode 100644 index 6538a8c..0000000 --- a/api/komante/services/komante.js +++ /dev/null @@ -1,8 +0,0 @@ -'use strict'; - -/** - * Read the documentation (https://strapi.io/documentation/developer-docs/latest/development/backend-customization.html#core-services) - * to customize this service - */ - -module.exports = {}; diff --git a/api/slugs/config/routes.json b/api/slugs/config/routes.json deleted file mode 100644 index 6708aca..0000000 --- a/api/slugs/config/routes.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "routes": [ - { - "method": "GET", - "path": "/slugs", - "handler": "slugs.index", - "config": { - "policies": [] - } - } - ] -} diff --git a/api/slugs/controllers/slugs.js b/api/slugs/controllers/slugs.js deleted file mode 100644 index a331c63..0000000 --- a/api/slugs/controllers/slugs.js +++ /dev/null @@ -1,12 +0,0 @@ -module.exports = { - index: async ctx => { - const result = await strapi - .query('teks').find({published_at_nin: null}) - const sortedResult = result.sort((a, b) => { - const aDate = new Date(a.published_at) - const bDate = new Date(b.published_at) - return bDate.getTime() - aDate.getTime() - }) - ctx.send(sortedResult.map(({slug}) => slug)); - } -} diff --git a/api/slugs/documentation/1.0.0/slugs.json b/api/slugs/documentation/1.0.0/slugs.json deleted file mode 100644 index 17959f1..0000000 --- a/api/slugs/documentation/1.0.0/slugs.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "paths": { - "/slugs": { - "get": { - "deprecated": false, - "description": "", - "responses": { - "200": { - "description": "response", - "content": { - "application/json": { - "schema": { - "properties": { - "foo": { - "type": "string" - } - } - } - } - } - }, - "403": { - "description": "Forbidden", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - }, - "404": { - "description": "Not found", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - }, - "default": { - "description": "unexpected error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - } - }, - "summary": "", - "tags": [ - "Slugs" - ], - "parameters": [] - } - } - }, - "tags": [ - { - "name": "Slugs" - } - ] -} \ No newline at end of file diff --git a/api/teks/config/routes.json b/api/teks/config/routes.json deleted file mode 100644 index 8c1722e..0000000 --- a/api/teks/config/routes.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "routes": [ - { - "method": "GET", - "path": "/teks", - "handler": "teks.find", - "config": { - "policies": [] - } - }, - { - "method": "GET", - "path": "/teks/count", - "handler": "teks.count", - "config": { - "policies": [] - } - }, - { - "method": "GET", - "path": "/teks/:id", - "handler": "teks.findOne", - "config": { - "policies": [] - } - }, - { - "method": "POST", - "path": "/teks", - "handler": "teks.create", - "config": { - "policies": [] - } - }, - { - "method": "PUT", - "path": "/teks/:id", - "handler": "teks.update", - "config": { - "policies": [] - } - }, - { - "method": "DELETE", - "path": "/teks/:id", - "handler": "teks.delete", - "config": { - "policies": [] - } - } - ] -} diff --git a/api/teks/controllers/teks.js b/api/teks/controllers/teks.js deleted file mode 100644 index b561106..0000000 --- a/api/teks/controllers/teks.js +++ /dev/null @@ -1,51 +0,0 @@ -'use strict'; - -const {default: createStrapi} = require('strapi'); -const {parseMultipartData, sanitizeEntity} = require('strapi-utils') - -/** - * Read the documentation (https://strapi.io/documentation/v3.x/concepts/controllers.html#core-controllers) - * to customize this controller - */ - - module.exports = { - async create(ctx) { - let entity - if (ctx.is('multipart')) { - let {data} = parseMultipartData(ctx) - data.published_at = null - entity = await createStrapi.services.teks.create(data) - } else { - let {body} = ctx.request - body.published_at = null - entity = await strapi.services.teks.create(body) - } - - return sanitizeEntity(entity, {model: strapi.models.teks}) - }, - - async update(ctx) { - const {id} = ctx.params; - - let entity - - const teks = await strapi.query('teks').findOne({ - id: ctx.params.id, - 'user.id': ctx.state.user.id, - published_at: null - }) - - if (!teks) { - return ctx.unauthorized(`Vous ne pouvez pas mettre à jour cet élément.`) - } - - if (ctx.is('multipart')) { - const {data} = parseMultipartData(ctx); - entity = await strapi.services.teks.update({id}, data) - } else { - entity = await strapi.services.teks.update({id}, ctx.request.body) - } - - return sanitizeEntity(entity, {model: strapi.models.teks}) - } -} diff --git a/api/teks/documentation/1.0.0/overrides/teks.json b/api/teks/documentation/1.0.0/overrides/teks.json deleted file mode 100644 index 4579556..0000000 --- a/api/teks/documentation/1.0.0/overrides/teks.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "paths": { - "/teks": { - "get": { - "parameters": [] - }, - "post": { - "deprecated": false - } - }, - "/teks/{id}" : { - "put": { - "deprecated": false - }, - "delete": { - "deprecated": true - } - } - } -} \ No newline at end of file diff --git a/api/teks/documentation/1.0.0/teks.json b/api/teks/documentation/1.0.0/teks.json deleted file mode 100644 index 52d8ff6..0000000 --- a/api/teks/documentation/1.0.0/teks.json +++ /dev/null @@ -1,1012 +0,0 @@ -{ - "paths": { - "/teks": { - "get": { - "deprecated": false, - "description": "Find all the teks's records", - "responses": { - "200": { - "description": "Retrieve teks document(s)", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Teks" - } - } - } - } - }, - "403": { - "description": "Forbidden", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - }, - "404": { - "description": "Not found", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - }, - "default": { - "description": "unexpected error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - } - }, - "summary": "", - "tags": [ - "Teks" - ], - "parameters": [ - { - "name": "_limit", - "in": "query", - "required": false, - "description": "Maximum number of results possible", - "schema": { - "type": "integer" - }, - "deprecated": false - }, - { - "name": "_sort", - "in": "query", - "required": false, - "description": "Sort according to a specific field.", - "schema": { - "type": "string" - }, - "deprecated": false - }, - { - "name": "_start", - "in": "query", - "required": false, - "description": "Skip a specific number of entries (especially useful for pagination)", - "schema": { - "type": "integer" - }, - "deprecated": false - }, - { - "name": "=", - "in": "query", - "required": false, - "description": "Get entries that matches exactly your input", - "schema": { - "type": "string" - }, - "deprecated": false - }, - { - "name": "_ne", - "in": "query", - "required": false, - "description": "Get records that are not equals to something", - "schema": { - "type": "string" - }, - "deprecated": false - }, - { - "name": "_lt", - "in": "query", - "required": false, - "description": "Get record that are lower than a value", - "schema": { - "type": "string" - }, - "deprecated": false - }, - { - "name": "_lte", - "in": "query", - "required": false, - "description": "Get records that are lower than or equal to a value", - "schema": { - "type": "string" - }, - "deprecated": false - }, - { - "name": "_gt", - "in": "query", - "required": false, - "description": "Get records that are greater than a value", - "schema": { - "type": "string" - }, - "deprecated": false - }, - { - "name": "_gte", - "in": "query", - "required": false, - "description": "Get records that are greater than or equal a value", - "schema": { - "type": "string" - }, - "deprecated": false - }, - { - "name": "_contains", - "in": "query", - "required": false, - "description": "Get records that contains a value", - "schema": { - "type": "string" - }, - "deprecated": false - }, - { - "name": "_containss", - "in": "query", - "required": false, - "description": "Get records that contains (case sensitive) a value", - "schema": { - "type": "string" - }, - "deprecated": false - }, - { - "name": "_in", - "in": "query", - "required": false, - "description": "Get records that matches any value in the array of values", - "schema": { - "type": "array", - "items": { - "type": "string" - } - }, - "deprecated": false - }, - { - "name": "_nin", - "in": "query", - "required": false, - "description": "Get records that doesn't match any value in the array of values", - "schema": { - "type": "array", - "items": { - "type": "string" - } - }, - "deprecated": false - } - ] - }, - "post": { - "deprecated": false, - "description": "Create a new teks record", - "responses": { - "200": { - "description": "Retrieve teks document(s)", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Teks" - } - } - } - }, - "403": { - "description": "Forbidden", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - }, - "404": { - "description": "Not found", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - }, - "default": { - "description": "unexpected error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - } - }, - "summary": "", - "tags": [ - "Teks" - ], - "requestBody": { - "description": "", - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NewTeks" - } - } - } - } - } - }, - "/teks/count": { - "get": { - "deprecated": false, - "description": "Retrieve the number of teks documents", - "responses": { - "200": { - "description": "Retrieve teks document(s)", - "content": { - "application/json": { - "schema": { - "properties": { - "count": { - "type": "integer" - } - } - } - } - } - }, - "403": { - "description": "Forbidden", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - }, - "404": { - "description": "Not found", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - }, - "default": { - "description": "unexpected error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - } - }, - "summary": "", - "tags": [ - "Teks" - ], - "parameters": [] - } - }, - "/teks/{id}": { - "get": { - "deprecated": false, - "description": "Find one teks record", - "responses": { - "200": { - "description": "Retrieve teks document(s)", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Teks" - } - } - } - }, - "403": { - "description": "Forbidden", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - }, - "404": { - "description": "Not found", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - }, - "default": { - "description": "unexpected error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - } - }, - "summary": "", - "tags": [ - "Teks" - ], - "parameters": [ - { - "name": "id", - "in": "path", - "description": "", - "deprecated": false, - "required": true, - "schema": { - "type": "string" - } - } - ] - }, - "put": { - "deprecated": false, - "description": "Update a single teks record", - "responses": { - "200": { - "description": "Retrieve teks document(s)", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Teks" - } - } - } - }, - "403": { - "description": "Forbidden", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - }, - "404": { - "description": "Not found", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - }, - "default": { - "description": "unexpected error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - } - }, - "summary": "", - "tags": [ - "Teks" - ], - "requestBody": { - "description": "", - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NewTeks" - } - } - } - }, - "parameters": [ - { - "name": "id", - "in": "path", - "description": "", - "deprecated": false, - "required": true, - "schema": { - "type": "string" - } - } - ] - }, - "delete": { - "deprecated": false, - "description": "Delete a single teks record", - "responses": { - "200": { - "description": "deletes a single teks based on the ID supplied", - "content": { - "application/json": { - "schema": { - "type": "integer", - "format": "int64" - } - } - } - }, - "403": { - "description": "Forbidden", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - }, - "404": { - "description": "Not found", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - }, - "default": { - "description": "unexpected error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - } - }, - "summary": "", - "tags": [ - "Teks" - ], - "parameters": [ - { - "name": "id", - "in": "path", - "description": "", - "deprecated": false, - "required": true, - "schema": { - "type": "string" - } - } - ] - } - } - }, - "components": { - "schemas": { - "Teks": { - "required": [ - "id", - "tit", - "transkripsyon" - ], - "properties": { - "id": { - "type": "string" - }, - "tit": { - "type": "string" - }, - "transkripsyon": { - "type": "string" - }, - "tradiksyon": { - "type": "object", - "required": [ - "id" - ], - "properties": { - "id": { - "type": "string" - }, - "francais": { - "type": "string" - }, - "english": { - "type": "string" - }, - "espagnol": { - "type": "string" - }, - "deutsch": { - "type": "string" - }, - "italiano": { - "type": "string" - } - } - }, - "lanne": { - "type": "integer" - }, - "lyen": { - "type": "array", - "items": { - "type": "object", - "required": [ - "id", - "url", - "sit" - ], - "properties": { - "id": { - "type": "string" - }, - "url": { - "type": "string" - }, - "sit": { - "type": "string", - "enum": [ - "Youtube", - "Peertube", - "Dailymotion", - "Vimeo", - "File", - "Lbry", - "Rumble" - ] - } - } - } - }, - "awtis": { - "type": "array", - "items": { - "required": [ - "id", - "alias" - ], - "properties": { - "id": { - "type": "string" - }, - "alias": { - "type": "string" - }, - "prenon": { - "type": "string" - }, - "non": { - "type": "string" - }, - "biyografi": { - "type": "string" - }, - "nesans": { - "type": "string" - }, - "foto": { - "type": "array", - "items": { - "type": "string" - } - }, - "teks": { - "type": "array", - "items": { - "type": "string" - } - }, - "user": { - "type": "string" - }, - "slug": { - "type": "string" - }, - "published_at": { - "type": "string" - }, - "created_by": { - "type": "string" - }, - "updated_by": { - "type": "string" - } - } - } - }, - "kouteyAchtey": { - "type": "array", - "items": { - "type": "object", - "required": [ - "id", - "url", - "boutik" - ], - "properties": { - "id": { - "type": "string" - }, - "url": { - "type": "string" - }, - "boutik": { - "type": "string", - "enum": [ - "Tidal", - "Spotify", - "Deezer", - "Qobuz", - "Youtubemusic", - "Applemusic", - "Amazon", - "Soundcloud" - ] - } - } - } - }, - "slug": { - "type": "string" - }, - "kouveti": { - "required": [ - "id", - "name", - "hash", - "mime", - "size", - "url", - "provider" - ], - "properties": { - "id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "alternativeText": { - "type": "string" - }, - "caption": { - "type": "string" - }, - "width": { - "type": "integer" - }, - "height": { - "type": "integer" - }, - "formats": { - "type": "object" - }, - "hash": { - "type": "string" - }, - "ext": { - "type": "string" - }, - "mime": { - "type": "string" - }, - "size": { - "type": "number" - }, - "url": { - "type": "string" - }, - "previewUrl": { - "type": "string" - }, - "provider": { - "type": "string" - }, - "provider_metadata": { - "type": "object" - }, - "related": { - "type": "string" - }, - "created_by": { - "type": "string" - }, - "updated_by": { - "type": "string" - } - } - }, - "okiMizikID": { - "type": "integer" - }, - "user": { - "required": [ - "id", - "username", - "email" - ], - "properties": { - "id": { - "type": "string" - }, - "username": { - "type": "string" - }, - "email": { - "type": "string" - }, - "provider": { - "type": "string" - }, - "password": { - "type": "string" - }, - "resetPasswordToken": { - "type": "string" - }, - "confirmationToken": { - "type": "string" - }, - "confirmed": { - "type": "boolean" - }, - "blocked": { - "type": "boolean" - }, - "role": { - "type": "string" - }, - "canAutoTranslate": { - "type": "boolean" - }, - "created_by": { - "type": "string" - }, - "updated_by": { - "type": "string" - } - } - }, - "eksplisit": { - "type": "boolean" - }, - "komante": { - "type": "array", - "items": { - "required": [ - "id", - "kontni", - "sentAt" - ], - "properties": { - "id": { - "type": "string" - }, - "kontni": { - "type": "string" - }, - "user": { - "type": "string" - }, - "teks": { - "type": "string" - }, - "sentAt": { - "type": "string" - }, - "published_at": { - "type": "string" - }, - "created_by": { - "type": "string" - }, - "updated_by": { - "type": "string" - } - } - } - }, - "forceSlug": { - "type": "boolean" - }, - "tradiksyonOtomatik": { - "type": "boolean" - }, - "userAdmin": { - "type": "string" - }, - "published_at": { - "type": "string", - "format": "date-time" - } - } - }, - "NewTeks": { - "required": [ - "tit", - "transkripsyon" - ], - "properties": { - "tit": { - "type": "string" - }, - "transkripsyon": { - "type": "string" - }, - "tradiksyon": { - "type": "object", - "required": [ - "id" - ], - "properties": { - "id": { - "type": "string" - }, - "francais": { - "type": "string" - }, - "english": { - "type": "string" - }, - "espagnol": { - "type": "string" - }, - "deutsch": { - "type": "string" - }, - "italiano": { - "type": "string" - } - } - }, - "lanne": { - "type": "integer" - }, - "lyen": { - "type": "array", - "items": { - "type": "object", - "required": [ - "id", - "url", - "sit" - ], - "properties": { - "id": { - "type": "string" - }, - "url": { - "type": "string" - }, - "sit": { - "type": "string", - "enum": [ - "Youtube", - "Peertube", - "Dailymotion", - "Vimeo", - "File", - "Lbry", - "Rumble" - ] - } - } - } - }, - "awtis": { - "type": "array", - "items": { - "type": "string" - } - }, - "kouteyAchtey": { - "type": "array", - "items": { - "type": "object", - "required": [ - "id", - "url", - "boutik" - ], - "properties": { - "id": { - "type": "string" - }, - "url": { - "type": "string" - }, - "boutik": { - "type": "string", - "enum": [ - "Tidal", - "Spotify", - "Deezer", - "Qobuz", - "Youtubemusic", - "Applemusic", - "Amazon", - "Soundcloud" - ] - } - } - } - }, - "slug": { - "type": "string" - }, - "okiMizikID": { - "type": "integer" - }, - "user": { - "type": "string" - }, - "eksplisit": { - "type": "boolean" - }, - "komante": { - "type": "array", - "items": { - "type": "string" - } - }, - "forceSlug": { - "type": "boolean" - }, - "tradiksyonOtomatik": { - "type": "boolean" - }, - "userAdmin": { - "type": "string" - }, - "published_at": { - "type": "string", - "format": "date-time" - }, - "created_by": { - "type": "string" - }, - "updated_by": { - "type": "string" - } - } - } - } - }, - "tags": [ - { - "name": "Teks" - } - ] -} \ No newline at end of file diff --git a/api/teks/services/teks.js b/api/teks/services/teks.js deleted file mode 100644 index 1f5330e..0000000 --- a/api/teks/services/teks.js +++ /dev/null @@ -1,8 +0,0 @@ -'use strict'; - -/** - * Read the documentation (https://strapi.io/documentation/v3.x/concepts/services.html#core-services) - * to customize this service - */ - -module.exports = {}; diff --git a/api/translator/services/translator.js b/api/translator/services/translator.js deleted file mode 100644 index 7f0de12..0000000 --- a/api/translator/services/translator.js +++ /dev/null @@ -1,39 +0,0 @@ -const qs = require('qs') -const axios = require('axios') - -class Translator { - constructor() { - this.deeplApi = process.env.DEEPL_URL || 'api-free.deepl.com' - this.deeplKey = process.env.DEEPL_KEY - this.urlRequest = `https://${this.deeplApi}/v2/translate` - } - - async get(origin, target, text) { - try { - const data = { - auth_key: this.deeplKey, - source_lang: origin, - target_lang: target, - text - } - const result = await axios.post(this.urlRequest, qs.stringify(data), { - headers: { - 'content-type': 'application/x-www-form-urlencoded' - } - }) - - return result.data - } catch (error) { - console.log('error', error) - } - } -} - -const translator = new Translator() - -async function translate(origin, target, text) { - const data = await translator.get(origin, target, text) - return data.translations[0].text -} - -module.exports = {translate}