mirror of
https://github.com/strapi/strapi.git
synced 2025-10-27 08:02:56 +00:00
commit
d77a8c03f3
@ -88,16 +88,16 @@ yarn develop
|
||||
|
||||
The server (API) is available at http://localhost:1337
|
||||
|
||||
**WARNING** ⚠️ If you've followed the recommended setup, you should not be able to reach the administration panel at http://localhost:1337/admin.
|
||||
The built administration panel is available at http://localhost:1337/admin
|
||||
|
||||
**Start the administration panel server**
|
||||
**Start the administration panel server for development**
|
||||
|
||||
```bash
|
||||
cd strapi/packages/strapi-admin
|
||||
yarn develop
|
||||
```
|
||||
```bash
|
||||
cd strapi/packages/strapi-admin
|
||||
yarn develop
|
||||
```
|
||||
|
||||
The administration panel is available at http://localhost:4000/admin
|
||||
The administration panel will be available at http://localhost:4000/admin
|
||||
|
||||
**Awesome! You are now able to contribute to Strapi.**
|
||||
|
||||
|
||||
@ -2,8 +2,16 @@ module.exports = {
|
||||
title: 'Strapi Documentation',
|
||||
description: 'The headless CMS developers love.',
|
||||
base: '/documentation/',
|
||||
ga: 'UA-54313258-1',
|
||||
plugins: ['@vuepress/medium-zoom', 'vuepress-plugin-element-tabs'],
|
||||
plugins: [
|
||||
'@vuepress/medium-zoom',
|
||||
'vuepress-plugin-element-tabs',
|
||||
[
|
||||
'@vuepress/google-analytics',
|
||||
{
|
||||
ga: 'UA-54313258-1',
|
||||
},
|
||||
],
|
||||
],
|
||||
head: [
|
||||
[
|
||||
'link',
|
||||
@ -116,7 +124,7 @@ module.exports = {
|
||||
},
|
||||
{
|
||||
text: 'Website',
|
||||
link: 'https://strapi',
|
||||
link: 'https://strapi.io',
|
||||
},
|
||||
{
|
||||
text: 'Slack',
|
||||
|
||||
@ -20,6 +20,18 @@
|
||||
>{{ $siteTitle }}</span>
|
||||
</router-link>
|
||||
|
||||
<span
|
||||
class="deprecated"
|
||||
v-if="isAlpha">
|
||||
Deprecated docs -
|
||||
<router-link
|
||||
:to="$localePath"
|
||||
class="home-link"
|
||||
>
|
||||
current version
|
||||
</router-link>
|
||||
</span>
|
||||
|
||||
<div
|
||||
class="links"
|
||||
:style="linksWrapMaxWidth ? {
|
||||
@ -43,7 +55,8 @@ export default {
|
||||
components: { SidebarButton, NavLinks, AlgoliaSearchBox, SearchBox},
|
||||
data () {
|
||||
return {
|
||||
linksWrapMaxWidth: null
|
||||
linksWrapMaxWidth: null,
|
||||
isAlpha: false
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
@ -59,6 +72,7 @@ export default {
|
||||
}
|
||||
handleLinksWrapWidth()
|
||||
window.addEventListener('resize', handleLinksWrapWidth, false)
|
||||
this.isAlpha = /documentation\/3.0.0-alpha.x/.test(window.location.href)
|
||||
},
|
||||
computed: {
|
||||
algolia () {
|
||||
@ -80,6 +94,12 @@ $navbar-horizontal-padding = 1.5rem
|
||||
.navbar
|
||||
padding $navbar-vertical-padding $navbar-horizontal-padding
|
||||
line-height $navbarHeight - 1.4rem
|
||||
.deprecated
|
||||
padding 0 0.5rem
|
||||
margin-left 1rem
|
||||
font-weight 600
|
||||
background-color #fff3cd
|
||||
border-radius .25rem
|
||||
a, span, img
|
||||
display inline-block
|
||||
.logo
|
||||
|
||||
@ -97,6 +97,12 @@ strapi(/* {...} */).start();
|
||||
|
||||
If you want to host the administration on another server than the API, [please take a look at this dedicated section](../admin-panel/deploy.md).
|
||||
|
||||
## Docker
|
||||
|
||||
In this section, you will not find a specific guide to deploy your app with [Docker](https://www.docker.com/).
|
||||
|
||||
We recently updated the [strapi/strapi-docker](https://github.com/strapi/strapi-docker) GitHub repository that contains all informations needed to user Strapi with Docker.
|
||||
|
||||
## Amazon AWS
|
||||
|
||||
This is a step-by-step guide for deploying a Strapi project to [Amazon AWS EC2](https://aws.amazon.com/ec2/). This guide will connect to an [Amazon AWS RDS](https://aws.amazon.com/rds/) for managing and hosting the database. Optionally, this guide will show you how to connect host and serve images on [Amazon AWS S3](https://aws.amazon.com/s3/). Prior to starting this guide, you should have created a [Strapi project](../getting-started/quick-start.md), to use for deploying on AWS.
|
||||
@ -995,7 +1001,7 @@ npm install pm2@latest -g
|
||||
|
||||
### The ecosystem.config.js file
|
||||
|
||||
- You will need to configure an `ecosystem.config.js` file. This file will manage the **database connection variables** Strapi needs to connect to your database. The `ecosystem.config.js` will also be used by `pm2` to restart your project whenever any changes are made to files within the Strapi file system itself (such as when an update arrives from GitHub). You can read more about this file [here](https://pm2.io/doc/en/runtime/guide/development-tools/).
|
||||
- You will need to configure an `ecosystem.config.js` file. This file will manage the **database connection variables** Strapi needs to connect to your database. The `ecosystem.config.js` will also be used by `pm2` to restart your project whenever any changes are made to files within the Strapi file system itself (such as when an update arrives from GitHub). You can read more about this file [here](https://pm2.keymetrics.io/docs/usage/pm2-doc-single-page/).
|
||||
|
||||
- You will need to open your `nano` editor and then `copy/paste` the following:
|
||||
|
||||
|
||||
@ -9,6 +9,7 @@
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@vuepress/plugin-medium-zoom": "^1.2.0",
|
||||
"@vuepress/plugin-google-analytics": "^1.2.0",
|
||||
"vuepress": "^1.2.0",
|
||||
"vuepress-plugin-element-tabs": "^0.1.8"
|
||||
}
|
||||
|
||||
@ -886,6 +886,11 @@
|
||||
dependencies:
|
||||
lodash.debounce "^4.0.8"
|
||||
|
||||
"@vuepress/plugin-google-analytics@^1.2.0":
|
||||
version "1.2.0"
|
||||
resolved "https://registry.yarnpkg.com/@vuepress/plugin-google-analytics/-/plugin-google-analytics-1.2.0.tgz#54555fd14f01a032c5acff04ecbbe0911577d7d0"
|
||||
integrity sha512-0zol5D4Efb5GKel7ADO/s65MLtKSLnOEGkeWzuipkWomSQPzP7TJ3+/RcYBnGdyBFHd1BSpTUHGK0b/IGwM3UA==
|
||||
|
||||
"@vuepress/plugin-last-updated@^1.2.0":
|
||||
version "1.2.0"
|
||||
resolved "https://registry.yarnpkg.com/@vuepress/plugin-last-updated/-/plugin-last-updated-1.2.0.tgz#7b34065b793848b0482a222b7a6f1b7df3668cdc"
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "getstarted",
|
||||
"private": true,
|
||||
"version": "3.0.0-beta.17.6",
|
||||
"version": "3.0.0-beta.17.8",
|
||||
"description": "A Strapi application.",
|
||||
"scripts": {
|
||||
"develop": "strapi develop",
|
||||
@ -15,22 +15,22 @@
|
||||
"mysql": "^2.17.1",
|
||||
"pg": "^7.10.0",
|
||||
"sqlite3": "^4.0.6",
|
||||
"strapi": "3.0.0-beta.17.6",
|
||||
"strapi-admin": "3.0.0-beta.17.6",
|
||||
"strapi-hook-bookshelf": "3.0.0-beta.17.6",
|
||||
"strapi-hook-knex": "3.0.0-beta.17.6",
|
||||
"strapi-hook-mongoose": "3.0.0-beta.17.6",
|
||||
"strapi-middleware-views": "3.0.0-beta.17.6",
|
||||
"strapi-plugin-content-manager": "3.0.0-beta.17.6",
|
||||
"strapi-plugin-content-type-builder": "3.0.0-beta.17.6",
|
||||
"strapi-plugin-documentation": "3.0.0-beta.17.6",
|
||||
"strapi-plugin-email": "3.0.0-beta.17.6",
|
||||
"strapi-plugin-graphql": "3.0.0-beta.17.6",
|
||||
"strapi-plugin-upload": "3.0.0-beta.17.6",
|
||||
"strapi-plugin-users-permissions": "3.0.0-beta.17.6",
|
||||
"strapi-provider-email-mailgun": "3.0.0-beta.17.6",
|
||||
"strapi-provider-upload-aws-s3": "3.0.0-beta.17.6",
|
||||
"strapi-utils": "3.0.0-beta.17.6"
|
||||
"strapi": "3.0.0-beta.17.8",
|
||||
"strapi-admin": "3.0.0-beta.17.8",
|
||||
"strapi-hook-bookshelf": "3.0.0-beta.17.8",
|
||||
"strapi-hook-knex": "3.0.0-beta.17.8",
|
||||
"strapi-hook-mongoose": "3.0.0-beta.17.8",
|
||||
"strapi-middleware-views": "3.0.0-beta.17.8",
|
||||
"strapi-plugin-content-manager": "3.0.0-beta.17.8",
|
||||
"strapi-plugin-content-type-builder": "3.0.0-beta.17.8",
|
||||
"strapi-plugin-documentation": "3.0.0-beta.17.8",
|
||||
"strapi-plugin-email": "3.0.0-beta.17.8",
|
||||
"strapi-plugin-graphql": "3.0.0-beta.17.8",
|
||||
"strapi-plugin-upload": "3.0.0-beta.17.8",
|
||||
"strapi-plugin-users-permissions": "3.0.0-beta.17.8",
|
||||
"strapi-provider-email-mailgun": "3.0.0-beta.17.8",
|
||||
"strapi-provider-upload-aws-s3": "3.0.0-beta.17.8",
|
||||
"strapi-utils": "3.0.0-beta.17.8"
|
||||
},
|
||||
"strapi": {
|
||||
"uuid": "getstarted"
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
{
|
||||
"version": "3.0.0-beta.17.6",
|
||||
"version": "3.0.0-beta.17.8",
|
||||
"packages": [
|
||||
"packages/*",
|
||||
"examples/*"
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "create-strapi-app",
|
||||
"version": "3.0.0-beta.17.6",
|
||||
"version": "3.0.0-beta.17.8",
|
||||
"description": "Generate a new Strapi application.",
|
||||
"license": "MIT",
|
||||
"homepage": "http://strapi.io",
|
||||
@ -21,7 +21,7 @@
|
||||
],
|
||||
"dependencies": {
|
||||
"commander": "^2.20.0",
|
||||
"strapi-generate-new": "3.0.0-beta.17.6"
|
||||
"strapi-generate-new": "3.0.0-beta.17.8"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "echo \"no tests yet\""
|
||||
|
||||
@ -1,47 +1,47 @@
|
||||
{
|
||||
"Analytics": "Аналитика",
|
||||
"Content Manager": "Редактор контента",
|
||||
"Content Type Builder": "Типы Контента",
|
||||
"Content Type Builder": "Конструктор типов контента",
|
||||
"Documentation": "Документация",
|
||||
"Email": "Email",
|
||||
"Email": "E-mail",
|
||||
"Files Upload": "Загрузка файлов",
|
||||
"HomePage.notification.newsLetter.success": "Успешная подписка на рассылку новостей",
|
||||
"HomePage.notification.newsLetter.success": "Успешная подписка на новостную рассылку",
|
||||
"New entry": "Новая запись",
|
||||
"Password": "Пароль",
|
||||
"Provider": "Провайдер",
|
||||
"ResetPasswordToken": "Сбросить токен пароля",
|
||||
"ResetPasswordToken": "Сброс токена пароля",
|
||||
"Role": "Роль",
|
||||
"Roles & Permissions": "Роли и доступы",
|
||||
"Settings Manager": "Менеджер Настроек",
|
||||
"Username": "Имя пользователя",
|
||||
"Users": "Пользователи",
|
||||
"Users & Permissions": "Пользователи & Доступы",
|
||||
"Users & Permissions": "Пользователи и доступы",
|
||||
"app.components.BlockLink.code": "Примеры кода",
|
||||
"app.components.BlockLink.code.content": "Обучайтесь на реальных проектах, разработанных в сообществе.",
|
||||
"app.components.BlockLink.documentation": "Прочитать документацию",
|
||||
"app.components.BlockLink.documentation": "Читать документацию",
|
||||
"app.components.BlockLink.documentation.content": "Ознакомьтесь с концепциями, справочниками и обучающими материалами.",
|
||||
"app.components.Button.cancel": "Отменить",
|
||||
"app.components.Button.save": "Сохранить",
|
||||
"app.components.ComingSoonPage.comingSoon": "Скоро",
|
||||
"app.components.ComingSoonPage.featuresNotAvailable": "Этот функционал все еще находится в стадии активной разработки.",
|
||||
"app.components.ComingSoonPage.featuresNotAvailable": "Этот функционал все еще находится в активной разработке.",
|
||||
"app.components.DownloadInfo.download": "Выполняется загрузка...",
|
||||
"app.components.DownloadInfo.text": "Это может занять около минуты. Спасибо за ваше терпение.",
|
||||
"app.components.EmptyAttributes.title": "Пока нет полей",
|
||||
"app.components.HomePage.button.blog": "СМОТРИТЕ БОЛЬШЕ В БЛОГЕ",
|
||||
"app.components.HomePage.button.quickStart": "ОЗНАКОМИТЬСЯ С РУКОВОДСТВОМ ПО БЫСТРОМУ СТАРТУ",
|
||||
"app.components.HomePage.community": "Найдите сообщество в интернете",
|
||||
"app.components.HomePage.community.content": "Обсуждайте с членами команды и разработчиками в разных каналах",
|
||||
"app.components.HomePage.community.content": "Обсуждайте с членами команды и разработчиками в разных каналах.",
|
||||
"app.components.HomePage.create": "Создайте ваш первый Тип Контента",
|
||||
"app.components.HomePage.createBlock.content.first": " ",
|
||||
"app.components.HomePage.createBlock.content.second": " — плагин, который поможет вам определить структуру ваших данных. Если вы новичок, мы настоятельно рекомендуем вам изучить наше ",
|
||||
"app.components.HomePage.createBlock.content.second": " — плагин, который поможет вам определить структуру ваших моделей данных. Если вы новичок, мы настоятельно рекомендуем вам изучить наше ",
|
||||
"app.components.HomePage.createBlock.content.tutorial": " руководство.",
|
||||
"app.components.HomePage.cta": "ПОДПИСАТЬСЯ",
|
||||
"app.components.HomePage.cta": "ПОДТВЕРДИТЬ",
|
||||
"app.components.HomePage.newsLetter": "Подпишитесь на рассылку, чтобы быть в курсе новостей Strapi",
|
||||
"app.components.HomePage.support": "ПОДДЕРЖИТЕ НАС",
|
||||
"app.components.HomePage.support.content": "Покупая футболку, вы помогаете нам продолжать работу над проектом и предоставлять вам наилучшее из возможных решений!",
|
||||
"app.components.HomePage.support.link": "ЗАКАЗАТЬ ФУТБОЛКУ СЕЙЧАС",
|
||||
"app.components.HomePage.welcome": "Добро пожаловать!",
|
||||
"app.components.HomePage.welcome.again": "Добро пожаловать, ",
|
||||
"app.components.HomePage.welcome": "Добро пожаловать на борт!",
|
||||
"app.components.HomePage.welcome.again": "Добро пожаловать ",
|
||||
"app.components.HomePage.welcomeBlock.content": "Мы рады, что вы присоединились к сообществу. Нам необходима обратная связь для развития проекта, поэтому не стесняйтесь писать нам в ",
|
||||
"app.components.HomePage.welcomeBlock.content.again": "Надеемся, что вы делаете успехи в вашем проекте... Следите за последними новостями Strapi. Мы стараемся изо всех сил, чтобы улучшить продукт, основываясь на ваших пожеланиях.",
|
||||
"app.components.HomePage.welcomeBlock.content.issues": "проблемах.",
|
||||
@ -50,14 +50,14 @@
|
||||
"app.components.ImgPreview.hint.browse": "выберите",
|
||||
"app.components.InputFile.newFile": "Добавить новый файл",
|
||||
"app.components.InputFileDetails.open": "Открыть в новой вкладке",
|
||||
"app.components.InputFileDetails.originalName": "Первоначальное название:",
|
||||
"app.components.InputFileDetails.originalName": "Оригинальное название:",
|
||||
"app.components.InputFileDetails.remove": "Удалить этот файл",
|
||||
"app.components.InputFileDetails.size": "Размер:",
|
||||
"app.components.InstallPluginPage.Download.title": "Загрузка...",
|
||||
"app.components.InstallPluginPage.Download.description": "Для загрузки и установки плагина может потребоваться несколько секунд.",
|
||||
"app.components.InstallPluginPage.InputSearch.label": " ",
|
||||
"app.components.InstallPluginPage.InputSearch.placeholder": "Искать плагин... (ex: authentication)",
|
||||
"app.components.InstallPluginPage.description": "Расширяйте ваше приложение без усилий.",
|
||||
"app.components.InstallPluginPage.InputSearch.placeholder": "Поиск плагина... (например: аутентификация)",
|
||||
"app.components.InstallPluginPage.description": "Расширяйте ваше приложение без особых усилий.",
|
||||
"app.components.InstallPluginPage.helmet": "Магазин - Плагины",
|
||||
"app.components.InstallPluginPage.plugin.support-us.description": "Поддержите нас, купив футболку Strapi. Это поможет нам продолжать работу над проектом, чтобы предоставить вам наилучшее из возможных решений!",
|
||||
"app.components.InstallPluginPage.title": "Магазин - Плагины",
|
||||
@ -65,9 +65,9 @@
|
||||
"app.components.InstallPluginPopup.navLink.avis": "avis",
|
||||
"app.components.InstallPluginPopup.navLink.changelog": "журнал изменений",
|
||||
"app.components.InstallPluginPopup.navLink.description": "Описание",
|
||||
"app.components.InstallPluginPopup.navLink.faq": "faq",
|
||||
"app.components.InstallPluginPopup.navLink.faq": "ФАК",
|
||||
"app.components.InstallPluginPopup.navLink.screenshots": "Скриншоты",
|
||||
"app.components.InstallPluginPopup.noDescription": "Нет описания",
|
||||
"app.components.InstallPluginPopup.noDescription": "Нет доступного описания",
|
||||
"app.components.LeftMenuFooter.documentation": "Документация",
|
||||
"app.components.LeftMenuFooter.help": "Помощь",
|
||||
"app.components.LeftMenuFooter.poweredBy": "Работает на ",
|
||||
@ -77,7 +77,7 @@
|
||||
"app.components.LeftMenuLinkContainer.listPlugins": "Плагины",
|
||||
"app.components.LeftMenuLinkContainer.noPluginsInstalled": "Нет установленных плагинов",
|
||||
"app.components.LeftMenuLinkContainer.plugins": "Плагины",
|
||||
"app.components.ListPluginsPage.description": "Список установленных плагинов.",
|
||||
"app.components.ListPluginsPage.description": "Список установленных плагинов в проекте.",
|
||||
"app.components.ListPluginsPage.helmet.title": "Список плагинов",
|
||||
"app.components.ListPluginsPage.title": "Плагины",
|
||||
"app.components.Logout.admin": "Управлять администраторами",
|
||||
@ -94,8 +94,8 @@
|
||||
"app.components.PluginCard.compatible": "Совместимо с вашим приложением",
|
||||
"app.components.PluginCard.compatibleCommunity": "Совместимо с сообществом",
|
||||
"app.components.PluginCard.more-details": "Больше деталей",
|
||||
"app.components.PluginCard.PopUpWarning.install.impossible.autoReload.needed": "Функция автоматической перезагрузки должна быть отключена. Пожалуйста, запустите ваше приложение с помощью `yarn develop`.",
|
||||
"app.components.PluginCard.PopUpWarning.install.impossible.environment": "В целях безопасности плагин может быть загружен только в develop-окружении.",
|
||||
"app.components.PluginCard.PopUpWarning.install.impossible.autoReload.needed": "Функция autoReload (автоматической перезагрузки) должна быть отключена. Пожалуйста, запустите ваше приложение с помощью `yarn develop`.",
|
||||
"app.components.PluginCard.PopUpWarning.install.impossible.environment": "В целях безопасности плагин может быть загружен только в среде разработки.",
|
||||
"app.components.PluginCard.PopUpWarning.install.impossible.confirm": "Я понимаю!",
|
||||
"app.components.PluginCard.PopUpWarning.install.impossible.title": "Загрузка невозможна",
|
||||
"app.components.PluginCard.price.free": "Бесплатно",
|
||||
@ -104,7 +104,7 @@
|
||||
"app.components.listPlugins.title.none": "Нет установленных плагинов",
|
||||
"app.components.listPlugins.title.plural": "{number} плагинов установлено",
|
||||
"app.components.listPlugins.title.singular": "{number} плагин установлен",
|
||||
"app.components.listPluginsPage.deletePlugin.error": "Возникла ошибка при установке плагина",
|
||||
"app.components.listPluginsPage.deletePlugin.error": "Произошла ошибка при удалении плагина",
|
||||
"app.utils.SelectOption.defaultMessage": " ",
|
||||
"app.utils.defaultMessage": " ",
|
||||
"app.utils.placeholder.defaultMessage": " ",
|
||||
@ -118,23 +118,24 @@
|
||||
"components.Input.error.custom-error": "{errorMessage} ",
|
||||
"components.Input.error.validation.email": "Это не адрес электронной почты",
|
||||
"components.Input.error.validation.json": "Не соответствует JSON формату",
|
||||
"components.Input.error.validation.max": "Слишком большое.",
|
||||
"components.Input.error.validation.maxLength": "Слишком длинное.",
|
||||
"components.Input.error.validation.min": "Слишком маленькое.",
|
||||
"components.Input.error.validation.minLength": "Слишком короткое.",
|
||||
"components.Input.error.validation.max": "Значение слишком большое.",
|
||||
"components.Input.error.validation.maxLength": "Значение слишком длинное.",
|
||||
"components.Input.error.validation.min": "Значение слишком маленькое.",
|
||||
"components.Input.error.validation.minLength": "Значение слишком короткое.",
|
||||
"components.Input.error.validation.minSupMax": "Не может быть выше",
|
||||
"components.Input.error.validation.regex": "Не соответствует регулярному выражению.",
|
||||
"components.Input.error.validation.required": "Необходимое поле для заполнения.",
|
||||
"components.Input.error.validation.regex": "Значение не соответствует регулярному выражению.",
|
||||
"components.Input.error.validation.required": "Обязательное значение.",
|
||||
"components.InputSelect.option.placeholder": "Выберите здесь",
|
||||
"components.ListRow.empty": "Нет данных для отображения.",
|
||||
"components.OverlayBlocker.description": "Вы воспользовались функционалом, который требует перезапуска сервера. Пожалуйста, подождите.",
|
||||
"components.OverlayBlocker.description": "Вы воспользовались функционалом, который требует перезапуска сервера. Пожалуйста, подождите, пока сервер не будет запущен.",
|
||||
"components.OverlayBlocker.description.serverError": "Сервер должен был перезагрузиться, пожалуйста, проверьте ваши логи в терминале.",
|
||||
"components.OverlayBlocker.title": "Ожидание перезапуска...",
|
||||
"components.OverlayBlocker.title.serverError": "Перезапуск занимает больше времени, чем ожидалось",
|
||||
"components.PageFooter.select": "записей на странице",
|
||||
"components.ProductionBlocker.description": "Для безопасности мы должны заблокировать его для других вариантов.",
|
||||
"components.ProductionBlocker.description": "В целях безопасности мы должны отключить этот плагин в других средах.",
|
||||
"components.ProductionBlocker.header": "Этот плагин доступен только на стадии разработки.",
|
||||
"components.Wysiwyg.ToggleMode.markdown": "Переключить в режим markdown",
|
||||
"components.Wysiwyg.ToggleMode.preview": "Переключить в режим предпросмотра",
|
||||
"components.Wysiwyg.ToggleMode.markdown": "Переключиться в режим markdown",
|
||||
"components.Wysiwyg.ToggleMode.preview": "Переключиться в режим предпросмотра",
|
||||
"components.Wysiwyg.collapse": "Свернуть",
|
||||
"components.Wysiwyg.selectOptions.H1": "Заголовок H1",
|
||||
"components.Wysiwyg.selectOptions.H2": "Заголовок H2",
|
||||
@ -143,7 +144,7 @@
|
||||
"components.Wysiwyg.selectOptions.H5": "Заголовок H5",
|
||||
"components.Wysiwyg.selectOptions.H6": "Заголовок H6",
|
||||
"components.Wysiwyg.selectOptions.title": "Добавить заголовок",
|
||||
"components.WysiwygBottomControls.charactersIndicators": "букв",
|
||||
"components.WysiwygBottomControls.charactersIndicators": "символов",
|
||||
"components.WysiwygBottomControls.fullscreen": "Развернуть",
|
||||
"components.WysiwygBottomControls.uploadFiles": "Перетащите файлы в эту область, вставьте из буфера обмена или {browse}.",
|
||||
"components.WysiwygBottomControls.uploadFiles.browse": "выберите их",
|
||||
@ -155,31 +156,41 @@
|
||||
"notification.error.layout": "Не удалось получить макет",
|
||||
"request.error.model.unknown": "Модель данных не существует",
|
||||
"app.utils.delete": "Удалить",
|
||||
"HomePage.helmet.title": "Домашняя страница",
|
||||
"HomePage.welcome.congrats": "Поздравляем!",
|
||||
"HomePage.welcome.congrats.content": "Вы вошли как первый администратор. Чтобы открыть для себя мощные функции, предоставляемые Strapi,",
|
||||
"HomePage.welcome.congrats.content.bold": "мы рекомендуем вам создать свой первый тип контента.",
|
||||
"HomePage.community": "Присоединяйтесь к сообществу",
|
||||
"HomePage.roadmap": "Смотрите нашу дорожную карту",
|
||||
"HomePage.greetings": "Привет {name}!",
|
||||
|
||||
"Auth.advanced.allow_register": "",
|
||||
"Auth.privacy-policy-agreement.terms": "условия",
|
||||
"Auth.privacy-policy-agreement.policy": "политика конфиденциальности",
|
||||
"Auth.form.button.forgot-password": "Отправить письмо",
|
||||
"Auth.form.button.forgot-password.success": "Отправить еще раз",
|
||||
"Auth.form.button.login": "Войти",
|
||||
"Auth.form.button.register": "Готов начать",
|
||||
"Auth.form.button.register-success": "Отправить еще раз",
|
||||
"Auth.form.button.reset-password": "Сменить пароль",
|
||||
"Auth.form.error.blocked": "Ваш аккаунт заблокирован администратором.",
|
||||
"Auth.form.error.code.provide": "Неверный код.",
|
||||
"Auth.form.error.confirmed": "Адрес электронной почты не подтвержден.",
|
||||
"Auth.form.error.email.invalid": "Неправильный адрес электронной почты.",
|
||||
"Auth.form.error.email.provide": "Укажите свое имя пользователя или адрес электронной почты.",
|
||||
"Auth.form.error.email.taken": "Данный email уже используется",
|
||||
"Auth.form.error.blocked": "Ваш аккаунт был заблокирован администратором.",
|
||||
"Auth.form.error.code.provide": "Указан неверный код.",
|
||||
"Auth.form.error.confirmed": "Ваш e-mail не подтвержден.",
|
||||
"Auth.form.error.email.invalid": "Неправильный e-mail.",
|
||||
"Auth.form.error.email.provide": "Укажите свое имя пользователя или e-mail.",
|
||||
"Auth.form.error.email.taken": "Данный e-mail уже используется",
|
||||
"Auth.form.error.invalid": "Неверный логин или пароль.",
|
||||
"Auth.form.error.noAdminAccess": "У вас нет доступа к панели администрирования.",
|
||||
"Auth.form.error.params.provide": "Неправильные параметры.",
|
||||
"Auth.form.error.params.provide": "Предоставлены неверные параметры.",
|
||||
"Auth.form.error.password.format": "Пароль не может содержать символ `$` больше трех раз.",
|
||||
"Auth.form.error.password.local": "Этот пользователь никогда не задавал пароль, пожалуйста, войдите в систему через провайдера, используемого при создании учетной записи.",
|
||||
"Auth.form.error.password.matching": "Пароль не соответствует.",
|
||||
"Auth.form.error.password.provide": "Укажите свой пароль.",
|
||||
"Auth.form.error.ratelimit": "Слишком много попыток. Пожалуйста, попробуйте позже.",
|
||||
"Auth.form.error.user.not-exist": "Этот email не существует.",
|
||||
"Auth.form.error.ratelimit": "Слишком много попыток, повторите через минуту",
|
||||
"Auth.form.error.user.not-exist": "Этот e-mail не существует.",
|
||||
"Auth.form.error.username.taken": "Имя пользователя уже используется",
|
||||
"Auth.form.forgot-password.email.label": "Введите ваш email",
|
||||
"Auth.form.forgot-password.email.label.success": "Письмо успешно отправлено",
|
||||
"Auth.form.forgot-password.email.label": "Введите ваш e-mail",
|
||||
"Auth.form.forgot-password.email.label.success": "Письмо успешно отправлено e-mail",
|
||||
"Auth.form.forgot-password.email.placeholder": "mysuperemail@gmail.com",
|
||||
"Auth.form.header.forgot-password": "strapi",
|
||||
"Auth.form.header.login": "strapi",
|
||||
@ -189,17 +200,20 @@
|
||||
"Auth.form.login.rememberMe.label": "Запомнить меня",
|
||||
"Auth.form.login.username.label": "Имя пользователя",
|
||||
"Auth.form.login.username.placeholder": "John Doe",
|
||||
"Auth.form.register-success.email.label": "Письмо успешно отправлено",
|
||||
"Auth.form.register-success.email.label": "Письмо успешно отправлено e-mail",
|
||||
"Auth.form.register-success.email.placeholder": "mysuperemail@gmail.com",
|
||||
"Auth.form.register.confirmPassword.label": "Подтверждение пароля",
|
||||
"Auth.form.register.email.label": "Email",
|
||||
"Auth.form.register.email.label": "E-mail",
|
||||
"Auth.form.register.email.placeholder": "johndoe@gmail.com",
|
||||
|
||||
"Auth.form.register.news.label": "Держите меня в курсе о новых функциях и предстоящих улучшениях (делая это, вы принимаете {terms} и {policy}).",
|
||||
"Auth.form.register.password.label": "Пароль",
|
||||
"Auth.form.register.username.label": "Имя пользователя",
|
||||
"Auth.form.register.username.placeholder": "John Doe",
|
||||
"Auth.header.register.description": "Для завершения установки и обеспечения безопасности приложения, создайте вашего первого пользователя (root admin), заполнив форму ниже.",
|
||||
"Auth.link.forgot-password": "Забыли пароль?",
|
||||
"Auth.link.ready": "Готовы войти?",
|
||||
"components.Input.error.password.noMatch": "Пароль не совпадает"
|
||||
"app.containers.App.notification.error.init": "Произошла ошибка при запросе к API",
|
||||
"components.Input.error.password.noMatch": "Пароль не совпадает",
|
||||
"form.button.done": "Выполнено",
|
||||
"notification.form.error.fields": "Форма содержит некоторые ошибки"
|
||||
}
|
||||
|
||||
@ -66,6 +66,11 @@ module.exports = {
|
||||
async installPlugin(ctx) {
|
||||
try {
|
||||
const { plugin } = ctx.request.body;
|
||||
|
||||
if (!/^[A-Za-z0-9_-]+$/.test(plugin)) {
|
||||
return ctx.badRequest('Invalid plugin name');
|
||||
}
|
||||
|
||||
strapi.reload.isWatching = false;
|
||||
|
||||
strapi.log.info(`Installing ${plugin}...`);
|
||||
@ -101,6 +106,11 @@ module.exports = {
|
||||
async uninstallPlugin(ctx) {
|
||||
try {
|
||||
const { plugin } = ctx.params;
|
||||
|
||||
if (!/^[A-Za-z0-9_-]+$/.test(plugin)) {
|
||||
return ctx.badRequest('Invalid plugin name');
|
||||
}
|
||||
|
||||
strapi.reload.isWatching = false;
|
||||
|
||||
strapi.log.info(`Uninstalling ${plugin}...`);
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "strapi-admin",
|
||||
"version": "3.0.0-beta.17.6",
|
||||
"version": "3.0.0-beta.17.8",
|
||||
"description": "Strapi Admin",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@ -69,8 +69,8 @@
|
||||
"reselect": "^3.0.1",
|
||||
"sanitize.css": "^4.1.0",
|
||||
"shelljs": "^0.7.8",
|
||||
"strapi-helper-plugin": "3.0.0-beta.17.6",
|
||||
"strapi-utils": "3.0.0-beta.17.6",
|
||||
"strapi-helper-plugin": "3.0.0-beta.17.8",
|
||||
"strapi-utils": "3.0.0-beta.17.8",
|
||||
"style-loader": "^0.23.1",
|
||||
"styled-components": "^4.2.0",
|
||||
"terser-webpack-plugin": "^1.2.3",
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "strapi-generate-api",
|
||||
"version": "3.0.0-beta.17.6",
|
||||
"version": "3.0.0-beta.17.8",
|
||||
"description": "Generate an API for a Strapi application.",
|
||||
"homepage": "http://strapi.io",
|
||||
"keywords": [
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "strapi-generate-controller",
|
||||
"version": "3.0.0-beta.17.6",
|
||||
"version": "3.0.0-beta.17.8",
|
||||
"description": "Generate a controller for a Strapi API.",
|
||||
"homepage": "http://strapi.io",
|
||||
"keywords": [
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "strapi-generate-model",
|
||||
"version": "3.0.0-beta.17.6",
|
||||
"version": "3.0.0-beta.17.8",
|
||||
"description": "Generate a model for a Strapi API.",
|
||||
"homepage": "http://strapi.io",
|
||||
"keywords": [
|
||||
|
||||
@ -39,6 +39,7 @@ module.exports = (projectDirectory, cliArguments) => {
|
||||
strapiVersion: require('../package.json').version,
|
||||
debug: cliArguments.debug !== undefined,
|
||||
quick: cliArguments.quickstart !== undefined,
|
||||
docker: process.env.DOCKER === 'true',
|
||||
uuid: uuid(),
|
||||
deviceId: machineIdSync(),
|
||||
tmpPath,
|
||||
@ -65,6 +66,7 @@ module.exports = (projectDirectory, cliArguments) => {
|
||||
os_release: os.release(),
|
||||
strapi_version: scope.strapiVersion,
|
||||
node_version: process.version,
|
||||
docker: scope.docker,
|
||||
};
|
||||
|
||||
Object.keys(tags).forEach(tag => {
|
||||
|
||||
@ -70,6 +70,7 @@ function trackError({ scope, error }) {
|
||||
release: os.release(),
|
||||
version: scope.strapiVersion,
|
||||
nodeVersion: process.version,
|
||||
docker: scope.docker,
|
||||
},
|
||||
});
|
||||
} catch (err) {
|
||||
@ -90,6 +91,7 @@ function trackUsage({ event, scope, error }) {
|
||||
os_release: os.release(),
|
||||
node_version: process.version,
|
||||
version: scope.strapiVersion,
|
||||
docker: scope.docker,
|
||||
},
|
||||
});
|
||||
} catch (err) {
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "strapi-generate-new",
|
||||
"version": "3.0.0-beta.17.6",
|
||||
"version": "3.0.0-beta.17.8",
|
||||
"description": "Generate a new Strapi application.",
|
||||
"homepage": "http://strapi.io",
|
||||
"keywords": [
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "strapi-generate-plugin",
|
||||
"version": "3.0.0-beta.17.6",
|
||||
"version": "3.0.0-beta.17.8",
|
||||
"description": "Generate an plugin for a Strapi application.",
|
||||
"homepage": "http://strapi.io",
|
||||
"keywords": [
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "strapi-generate-policy",
|
||||
"version": "3.0.0-beta.17.6",
|
||||
"version": "3.0.0-beta.17.8",
|
||||
"description": "Generate a policy for a Strapi API.",
|
||||
"homepage": "http://strapi.io",
|
||||
"keywords": [
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "strapi-generate-service",
|
||||
"version": "3.0.0-beta.17.6",
|
||||
"version": "3.0.0-beta.17.8",
|
||||
"description": "Generate a service for a Strapi API.",
|
||||
"homepage": "http://strapi.io",
|
||||
"keywords": [
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "strapi-generate",
|
||||
"version": "3.0.0-beta.17.6",
|
||||
"version": "3.0.0-beta.17.8",
|
||||
"description": "Master of ceremonies for the Strapi generators.",
|
||||
"homepage": "http://strapi.io",
|
||||
"keywords": [
|
||||
@ -20,7 +20,7 @@
|
||||
"fs-extra": "^8.0.1",
|
||||
"lodash": "^4.17.11",
|
||||
"reportback": "^2.0.2",
|
||||
"strapi-utils": "3.0.0-beta.17.6"
|
||||
"strapi-utils": "3.0.0-beta.17.8"
|
||||
},
|
||||
"author": {
|
||||
"name": "Strapi team",
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "strapi-helper-plugin",
|
||||
"version": "3.0.0-beta.17.6",
|
||||
"version": "3.0.0-beta.17.8",
|
||||
"description": "Helper for Strapi plugins development",
|
||||
"files": [
|
||||
"dist"
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "strapi-hook-bookshelf",
|
||||
"version": "3.0.0-beta.17.6",
|
||||
"version": "3.0.0-beta.17.8",
|
||||
"description": "Bookshelf hook for the Strapi framework",
|
||||
"homepage": "http://strapi.io",
|
||||
"keywords": [
|
||||
@ -22,8 +22,8 @@
|
||||
"lodash": "^4.17.11",
|
||||
"pluralize": "^7.0.0",
|
||||
"rimraf": "^2.6.3",
|
||||
"strapi-hook-knex": "3.0.0-beta.17.6",
|
||||
"strapi-utils": "3.0.0-beta.17.6"
|
||||
"strapi-hook-knex": "3.0.0-beta.17.8",
|
||||
"strapi-utils": "3.0.0-beta.17.8"
|
||||
},
|
||||
"strapi": {
|
||||
"dependencies": [
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "strapi-hook-ejs",
|
||||
"version": "3.0.0-beta.17.6",
|
||||
"version": "3.0.0-beta.17.8",
|
||||
"description": "EJS hook for the Strapi framework",
|
||||
"homepage": "http://strapi.io",
|
||||
"keywords": [
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "strapi-hook-knex",
|
||||
"version": "3.0.0-beta.17.6",
|
||||
"version": "3.0.0-beta.17.8",
|
||||
"description": "Knex hook for the Strapi framework",
|
||||
"homepage": "http://strapi.io",
|
||||
"keywords": [
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "strapi-hook-mongoose",
|
||||
"version": "3.0.0-beta.17.6",
|
||||
"version": "3.0.0-beta.17.8",
|
||||
"description": "Mongoose hook for the Strapi framework",
|
||||
"homepage": "http://strapi.io",
|
||||
"keywords": [
|
||||
@ -20,7 +20,7 @@
|
||||
"mongoose-float": "^1.0.4",
|
||||
"mongoose-long": "^0.2.1",
|
||||
"pluralize": "^7.0.0",
|
||||
"strapi-utils": "3.0.0-beta.17.6"
|
||||
"strapi-utils": "3.0.0-beta.17.8"
|
||||
},
|
||||
"author": {
|
||||
"email": "hi@strapi.io",
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "strapi-hook-redis",
|
||||
"version": "3.0.0-beta.17.6",
|
||||
"version": "3.0.0-beta.17.8",
|
||||
"description": "Redis hook for the Strapi framework",
|
||||
"homepage": "http://strapi.io",
|
||||
"keywords": [
|
||||
@ -19,7 +19,7 @@
|
||||
"lodash": "^4.17.11",
|
||||
"rimraf": "^2.6.3",
|
||||
"stack-trace": "0.0.10",
|
||||
"strapi-utils": "3.0.0-beta.17.6"
|
||||
"strapi-utils": "3.0.0-beta.17.8"
|
||||
},
|
||||
"author": {
|
||||
"email": "hi@strapi.io",
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "strapi-middleware-views",
|
||||
"version": "3.0.0-beta.17.6",
|
||||
"version": "3.0.0-beta.17.8",
|
||||
"description": "Views middleware to enable server-side rendering for the Strapi framework",
|
||||
"homepage": "http://strapi.io",
|
||||
"keywords": [
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "strapi-plugin-content-manager",
|
||||
"version": "3.0.0-beta.17.6",
|
||||
"version": "3.0.0-beta.17.8",
|
||||
"description": "A powerful UI to easily manage your data.",
|
||||
"strapi": {
|
||||
"name": "Content Manager",
|
||||
@ -32,8 +32,8 @@
|
||||
"redux-immutable": "^4.0.0",
|
||||
"reselect": "^3.0.1",
|
||||
"showdown": "^1.9.0",
|
||||
"strapi-helper-plugin": "3.0.0-beta.17.6",
|
||||
"strapi-utils": "3.0.0-beta.17.6",
|
||||
"strapi-helper-plugin": "3.0.0-beta.17.8",
|
||||
"strapi-utils": "3.0.0-beta.17.8",
|
||||
"styled-components": "^4.2.0",
|
||||
"yup": "^0.27.0"
|
||||
},
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "strapi-plugin-content-type-builder",
|
||||
"version": "3.0.0-beta.17.6",
|
||||
"version": "3.0.0-beta.17.8",
|
||||
"description": "Strapi plugin to create content type (API).",
|
||||
"strapi": {
|
||||
"name": "Content Type Builder",
|
||||
@ -29,9 +29,9 @@
|
||||
"redux": "^4.0.1",
|
||||
"redux-immutable": "^4.0.0",
|
||||
"reselect": "^3.0.1",
|
||||
"strapi-generate": "3.0.0-beta.17.6",
|
||||
"strapi-generate-api": "3.0.0-beta.17.6",
|
||||
"strapi-helper-plugin": "3.0.0-beta.17.6",
|
||||
"strapi-generate": "3.0.0-beta.17.8",
|
||||
"strapi-generate-api": "3.0.0-beta.17.8",
|
||||
"strapi-helper-plugin": "3.0.0-beta.17.8",
|
||||
"yup": "^0.27.0"
|
||||
},
|
||||
"author": {
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "strapi-plugin-documentation",
|
||||
"version": "3.0.0-beta.17.6",
|
||||
"version": "3.0.0-beta.17.8",
|
||||
"description": "This is the description of the plugin.",
|
||||
"strapi": {
|
||||
"name": "Documentation",
|
||||
@ -32,7 +32,7 @@
|
||||
"redux": "^4.0.1",
|
||||
"redux-immutable": "^4.0.0",
|
||||
"reselect": "^4.0.0",
|
||||
"strapi-helper-plugin": "3.0.0-beta.17.6",
|
||||
"strapi-helper-plugin": "3.0.0-beta.17.8",
|
||||
"swagger-ui-dist": "3.22.1"
|
||||
},
|
||||
"author": {
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "strapi-plugin-email",
|
||||
"version": "3.0.0-beta.17.6",
|
||||
"version": "3.0.0-beta.17.8",
|
||||
"description": "This is the description of the plugin.",
|
||||
"strapi": {
|
||||
"name": "Email",
|
||||
@ -12,13 +12,13 @@
|
||||
"test": "echo \"no tests yet\""
|
||||
},
|
||||
"dependencies": {
|
||||
"strapi-provider-email-sendmail": "3.0.0-beta.17.6",
|
||||
"strapi-utils": "3.0.0-beta.17.6"
|
||||
"strapi-provider-email-sendmail": "3.0.0-beta.17.8",
|
||||
"strapi-utils": "3.0.0-beta.17.8"
|
||||
},
|
||||
"devDependencies": {
|
||||
"react-copy-to-clipboard": "5.0.1",
|
||||
"rimraf": "^2.6.3",
|
||||
"strapi-helper-plugin": "3.0.0-beta.17.6"
|
||||
"strapi-helper-plugin": "3.0.0-beta.17.8"
|
||||
},
|
||||
"author": {
|
||||
"name": "Strapi team",
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "strapi-plugin-graphql",
|
||||
"version": "3.0.0-beta.17.6",
|
||||
"version": "3.0.0-beta.17.8",
|
||||
"description": "This is the description of the plugin.",
|
||||
"strapi": {
|
||||
"name": "graphql",
|
||||
@ -23,7 +23,7 @@
|
||||
"graphql-type-long": "^0.1.1",
|
||||
"koa-compose": "^4.1.0",
|
||||
"pluralize": "^7.0.0",
|
||||
"strapi-utils": "3.0.0-beta.17.6"
|
||||
"strapi-utils": "3.0.0-beta.17.8"
|
||||
},
|
||||
"devDependencies": {
|
||||
"cross-env": "^5.2.0",
|
||||
|
||||
@ -7,6 +7,8 @@
|
||||
const _ = require('lodash');
|
||||
const pluralize = require('pluralize');
|
||||
const { convertRestQueryParams, buildQuery } = require('strapi-utils');
|
||||
const policyUtils = require('strapi-utils').policy;
|
||||
const compose = require('koa-compose');
|
||||
|
||||
const Schema = require('./Schema.js');
|
||||
const GraphQLQuery = require('./Query.js');
|
||||
@ -470,7 +472,13 @@ const formatConnectionAggregator = function(fields, model, modelName) {
|
||||
* }
|
||||
*
|
||||
*/
|
||||
const formatModelConnectionsGQL = function(fields, model, name, modelResolver) {
|
||||
const formatModelConnectionsGQL = function(
|
||||
fields,
|
||||
model,
|
||||
name,
|
||||
modelResolver,
|
||||
plugin
|
||||
) {
|
||||
const { globalId } = model;
|
||||
|
||||
const connectionGlobalId = `${globalId}Connection`;
|
||||
@ -501,7 +509,50 @@ const formatModelConnectionsGQL = function(fields, model, name, modelResolver) {
|
||||
},
|
||||
resolver: {
|
||||
Query: {
|
||||
[`${pluralName}Connection`](obj, options, context) {
|
||||
async [`${pluralName}Connection`](obj, options, { context }) {
|
||||
// need to check
|
||||
|
||||
const ctx = Object.assign(_.clone(context), {
|
||||
request: Object.assign(_.clone(context.request), {
|
||||
graphql: null,
|
||||
}),
|
||||
});
|
||||
|
||||
const policiesFn = [
|
||||
policyUtils.globalPolicy(
|
||||
undefined,
|
||||
{
|
||||
handler: `${name}.find`,
|
||||
},
|
||||
undefined,
|
||||
plugin
|
||||
),
|
||||
];
|
||||
|
||||
policyUtils.get(
|
||||
'plugins.users-permissions.permissions',
|
||||
plugin,
|
||||
policiesFn,
|
||||
`GraphQL connection "${name}" `,
|
||||
name
|
||||
);
|
||||
|
||||
// Execute policies stack.
|
||||
const policy = await compose(policiesFn)(ctx);
|
||||
|
||||
// Policy doesn't always return errors but they update the current context.
|
||||
if (
|
||||
_.isError(ctx.request.graphql) ||
|
||||
_.get(ctx.request.graphql, 'isBoom')
|
||||
) {
|
||||
return ctx.request.graphql;
|
||||
}
|
||||
|
||||
// Something went wrong in the policy.
|
||||
if (policy) {
|
||||
return policy;
|
||||
}
|
||||
|
||||
return options;
|
||||
},
|
||||
},
|
||||
|
||||
@ -60,152 +60,161 @@ const buildAssocResolvers = (model, name, { plugin }) => {
|
||||
const { primaryKey, associations = [] } = model;
|
||||
|
||||
return associations
|
||||
.filter(association => model.attributes[association.alias].private !== true)
|
||||
.reduce((resolver, association) => {
|
||||
switch (association.nature) {
|
||||
case 'oneToManyMorph': {
|
||||
resolver[association.alias] = async obj => {
|
||||
const entry = await contentManager.fetch(
|
||||
{
|
||||
id: obj[primaryKey],
|
||||
model: name,
|
||||
},
|
||||
plugin,
|
||||
[association.alias]
|
||||
);
|
||||
|
||||
// Set the _type only when the value is defined
|
||||
if (entry[association.alias]) {
|
||||
entry[association.alias]._type = _.upperFirst(association.model);
|
||||
}
|
||||
|
||||
return entry[association.alias];
|
||||
};
|
||||
break;
|
||||
}
|
||||
case 'manyMorphToOne':
|
||||
case 'manyMorphToMany':
|
||||
case 'manyToManyMorph': {
|
||||
resolver[association.alias] = async obj => {
|
||||
// eslint-disable-line no-unused-vars
|
||||
const [withRelated, withoutRelated] = await Promise.all([
|
||||
contentManager.fetch(
|
||||
.filter(association => model.attributes[association.alias].private !== true)
|
||||
.reduce((resolver, association) => {
|
||||
switch (association.nature) {
|
||||
case 'oneToManyMorph': {
|
||||
resolver[association.alias] = async obj => {
|
||||
const entry = await contentManager.fetch(
|
||||
{
|
||||
id: obj[primaryKey],
|
||||
model: name,
|
||||
},
|
||||
plugin,
|
||||
[association.alias],
|
||||
false
|
||||
),
|
||||
contentManager.fetch(
|
||||
{
|
||||
id: obj[primaryKey],
|
||||
model: name,
|
||||
},
|
||||
plugin,
|
||||
[]
|
||||
),
|
||||
]);
|
||||
|
||||
const entry =
|
||||
withRelated && withRelated.toJSON
|
||||
? withRelated.toJSON()
|
||||
: withRelated;
|
||||
|
||||
entry[association.alias].map((entry, index) => {
|
||||
const type =
|
||||
_.get(withoutRelated, `${association.alias}.${index}.kind`) ||
|
||||
_.upperFirst(
|
||||
_.camelCase(
|
||||
_.get(
|
||||
withoutRelated,
|
||||
`${association.alias}.${index}.${association.alias}_type`
|
||||
)
|
||||
)
|
||||
) ||
|
||||
_.upperFirst(_.camelCase(association[association.type]));
|
||||
|
||||
entry._type = type;
|
||||
|
||||
return entry;
|
||||
});
|
||||
|
||||
return entry[association.alias];
|
||||
};
|
||||
break;
|
||||
}
|
||||
|
||||
default: {
|
||||
resolver[association.alias] = async (obj, options) => {
|
||||
// Construct parameters object to retrieve the correct related entries.
|
||||
const params = {
|
||||
model: association.model || association.collection,
|
||||
};
|
||||
|
||||
let queryOpts = {
|
||||
source: association.plugin,
|
||||
};
|
||||
|
||||
// Get refering model.
|
||||
const ref = association.plugin
|
||||
? strapi.plugins[association.plugin].models[params.model]
|
||||
: strapi.models[params.model];
|
||||
|
||||
if (association.type === 'model') {
|
||||
params[ref.primaryKey] = _.get(
|
||||
obj,
|
||||
[association.alias, ref.primaryKey],
|
||||
obj[association.alias]
|
||||
[association.alias]
|
||||
);
|
||||
} else {
|
||||
const queryParams = Query.amountLimiting(options);
|
||||
queryOpts = {
|
||||
...queryOpts,
|
||||
...Query.convertToParams(_.omit(queryParams, 'where')), // Convert filters (sort, limit and start/skip)
|
||||
...Query.convertToQuery(queryParams.where),
|
||||
|
||||
// Set the _type only when the value is defined
|
||||
if (entry[association.alias]) {
|
||||
entry[association.alias]._type = _.upperFirst(association.model);
|
||||
}
|
||||
|
||||
return entry[association.alias];
|
||||
};
|
||||
break;
|
||||
}
|
||||
case 'manyMorphToOne':
|
||||
case 'manyMorphToMany':
|
||||
case 'manyToManyMorph': {
|
||||
resolver[association.alias] = async obj => {
|
||||
// eslint-disable-line no-unused-vars
|
||||
const [withRelated, withoutRelated] = await Promise.all([
|
||||
contentManager.fetch(
|
||||
{
|
||||
id: obj[primaryKey],
|
||||
model: name,
|
||||
},
|
||||
plugin,
|
||||
[association.alias],
|
||||
false
|
||||
),
|
||||
contentManager.fetch(
|
||||
{
|
||||
id: obj[primaryKey],
|
||||
model: name,
|
||||
},
|
||||
plugin,
|
||||
[]
|
||||
),
|
||||
]);
|
||||
|
||||
const entry =
|
||||
withRelated && withRelated.toJSON
|
||||
? withRelated.toJSON()
|
||||
: withRelated;
|
||||
|
||||
entry[association.alias].map((entry, index) => {
|
||||
const type =
|
||||
_.get(withoutRelated, `${association.alias}.${index}.kind`) ||
|
||||
_.upperFirst(
|
||||
_.camelCase(
|
||||
_.get(
|
||||
withoutRelated,
|
||||
`${association.alias}.${index}.${association.alias}_type`
|
||||
)
|
||||
)
|
||||
) ||
|
||||
_.upperFirst(_.camelCase(association[association.type]));
|
||||
|
||||
entry._type = type;
|
||||
|
||||
return entry;
|
||||
});
|
||||
|
||||
return entry[association.alias];
|
||||
};
|
||||
break;
|
||||
}
|
||||
|
||||
default: {
|
||||
resolver[association.alias] = async (obj, options) => {
|
||||
// Construct parameters object to retrieve the correct related entries.
|
||||
const params = {
|
||||
model: association.model || association.collection,
|
||||
};
|
||||
|
||||
if (
|
||||
((association.nature === 'manyToMany' && association.dominant) ||
|
||||
association.nature === 'manyWay') &&
|
||||
_.has(obj, association.alias) // if populated
|
||||
) {
|
||||
_.set(
|
||||
queryOpts,
|
||||
['query', ref.primaryKey],
|
||||
let queryOpts = {
|
||||
source: association.plugin,
|
||||
};
|
||||
|
||||
// Get refering model.
|
||||
const ref = association.plugin
|
||||
? strapi.plugins[association.plugin].models[params.model]
|
||||
: strapi.models[params.model];
|
||||
|
||||
if (association.type === 'model') {
|
||||
params[ref.primaryKey] = _.get(
|
||||
obj,
|
||||
[association.alias, ref.primaryKey],
|
||||
obj[association.alias]
|
||||
? obj[association.alias]
|
||||
.map(val => val[ref.primaryKey] || val)
|
||||
.sort()
|
||||
: []
|
||||
);
|
||||
} else {
|
||||
_.set(queryOpts, ['query', association.via], obj[ref.primaryKey]);
|
||||
const queryParams = Query.amountLimiting(options);
|
||||
queryOpts = {
|
||||
...queryOpts,
|
||||
...Query.convertToParams(_.omit(queryParams, 'where')), // Convert filters (sort, limit and start/skip)
|
||||
...Query.convertToQuery(queryParams.where),
|
||||
};
|
||||
|
||||
if (
|
||||
((association.nature === 'manyToMany' &&
|
||||
association.dominant) ||
|
||||
association.nature === 'manyWay') &&
|
||||
_.has(obj, association.alias) // if populated
|
||||
) {
|
||||
_.set(
|
||||
queryOpts,
|
||||
['query', ref.primaryKey],
|
||||
obj[association.alias]
|
||||
? obj[association.alias]
|
||||
.map(val => val[ref.primaryKey] || val)
|
||||
.sort()
|
||||
: []
|
||||
);
|
||||
} else {
|
||||
_.set(
|
||||
queryOpts,
|
||||
['query', association.via],
|
||||
obj[ref.primaryKey]
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const loaderName = association.plugin
|
||||
? `${association.plugin}__${params.model}`
|
||||
: params.model;
|
||||
const loaderName = association.plugin
|
||||
? `${association.plugin}__${params.model}`
|
||||
: params.model;
|
||||
|
||||
return association.model
|
||||
? strapi.plugins.graphql.services.loaders.loaders[loaderName].load({
|
||||
params,
|
||||
options: queryOpts,
|
||||
single: true,
|
||||
})
|
||||
: strapi.plugins.graphql.services.loaders.loaders[loaderName].load({
|
||||
options: queryOpts,
|
||||
association,
|
||||
});
|
||||
};
|
||||
break;
|
||||
return association.model
|
||||
? strapi.plugins.graphql.services.loaders.loaders[
|
||||
loaderName
|
||||
].load({
|
||||
params,
|
||||
options: queryOpts,
|
||||
single: true,
|
||||
})
|
||||
: strapi.plugins.graphql.services.loaders.loaders[
|
||||
loaderName
|
||||
].load({
|
||||
options: queryOpts,
|
||||
association,
|
||||
});
|
||||
};
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return resolver;
|
||||
}, {});
|
||||
return resolver;
|
||||
}, {});
|
||||
};
|
||||
|
||||
const buildModel = (model, name, { plugin, isGroup = false } = {}) => {
|
||||
@ -475,7 +484,8 @@ const buildShadowCRUD = (models, plugin) => {
|
||||
attributes,
|
||||
model,
|
||||
name,
|
||||
queries.plural
|
||||
queries.plural,
|
||||
plugin
|
||||
);
|
||||
if (modelAggregator) {
|
||||
acc.definition += modelAggregator.type;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "strapi-plugin-upload",
|
||||
"version": "3.0.0-beta.17.6",
|
||||
"version": "3.0.0-beta.17.8",
|
||||
"description": "This is the description of the plugin.",
|
||||
"strapi": {
|
||||
"name": "Files Upload",
|
||||
@ -23,9 +23,9 @@
|
||||
"react-router-dom": "^5.0.0",
|
||||
"react-transition-group": "^2.5.0",
|
||||
"reactstrap": "^5.0.0",
|
||||
"strapi-helper-plugin": "3.0.0-beta.17.6",
|
||||
"strapi-provider-upload-local": "3.0.0-beta.17.6",
|
||||
"strapi-utils": "3.0.0-beta.17.6",
|
||||
"strapi-helper-plugin": "3.0.0-beta.17.8",
|
||||
"strapi-provider-upload-local": "3.0.0-beta.17.8",
|
||||
"strapi-utils": "3.0.0-beta.17.8",
|
||||
"stream-to-array": "^2.3.0",
|
||||
"uuid": "^3.2.1"
|
||||
},
|
||||
|
||||
@ -272,7 +272,22 @@ module.exports = {
|
||||
},
|
||||
|
||||
async forgotPassword(ctx) {
|
||||
const { email } = ctx.request.body;
|
||||
let { email } = ctx.request.body;
|
||||
|
||||
// Check if the provided email is valid or not.
|
||||
const isEmail = emailRegExp.test(email);
|
||||
|
||||
if (isEmail) {
|
||||
email = email.toLowerCase();
|
||||
} else {
|
||||
return ctx.badRequest(
|
||||
null,
|
||||
formatError({
|
||||
id: 'Auth.form.error.email.format',
|
||||
message: 'Please provide valid email address.',
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
const pluginStore = await strapi.store({
|
||||
environment: '',
|
||||
@ -620,7 +635,7 @@ module.exports = {
|
||||
}
|
||||
|
||||
const user = await strapi.query('user', 'users-permissions').findOne({
|
||||
email: params.email
|
||||
email: params.email,
|
||||
});
|
||||
|
||||
if (user.confirmed) {
|
||||
@ -635,22 +650,38 @@ module.exports = {
|
||||
_.pick(user.toJSON ? user.toJSON() : user, ['id'])
|
||||
);
|
||||
|
||||
const settings = await pluginStore.get({ key: 'email' }).then(storeEmail => {
|
||||
try {
|
||||
return storeEmail['email_confirmation'].options;
|
||||
} catch (err) {
|
||||
return {};
|
||||
}
|
||||
});
|
||||
const settings = await pluginStore
|
||||
.get({ key: 'email' })
|
||||
.then(storeEmail => {
|
||||
try {
|
||||
return storeEmail['email_confirmation'].options;
|
||||
} catch (err) {
|
||||
return {};
|
||||
}
|
||||
});
|
||||
|
||||
settings.message = await strapi.plugins['users-permissions'].services.userspermissions.template(settings.message, {
|
||||
settings.message = await strapi.plugins[
|
||||
'users-permissions'
|
||||
].services.userspermissions.template(settings.message, {
|
||||
URL: new URL('/auth/email-confirmation', strapi.config.url).toString(),
|
||||
USER: _.omit(user.toJSON ? user.toJSON() : user, ['password', 'resetPasswordToken', 'role', 'provider']),
|
||||
CODE: jwt
|
||||
USER: _.omit(user.toJSON ? user.toJSON() : user, [
|
||||
'password',
|
||||
'resetPasswordToken',
|
||||
'role',
|
||||
'provider',
|
||||
]),
|
||||
CODE: jwt,
|
||||
});
|
||||
|
||||
settings.object = await strapi.plugins['users-permissions'].services.userspermissions.template(settings.object, {
|
||||
USER: _.omit(user.toJSON ? user.toJSON() : user, ['password', 'resetPasswordToken', 'role', 'provider']),
|
||||
settings.object = await strapi.plugins[
|
||||
'users-permissions'
|
||||
].services.userspermissions.template(settings.object, {
|
||||
USER: _.omit(user.toJSON ? user.toJSON() : user, [
|
||||
'password',
|
||||
'resetPasswordToken',
|
||||
'role',
|
||||
'provider',
|
||||
]),
|
||||
});
|
||||
|
||||
try {
|
||||
@ -663,11 +694,11 @@ module.exports = {
|
||||
replyTo: settings.response_email,
|
||||
subject: settings.object,
|
||||
text: settings.message,
|
||||
html: settings.message
|
||||
html: settings.message,
|
||||
});
|
||||
ctx.send({
|
||||
email: (user.toJSON ? user.toJSON() : user).email,
|
||||
sent: true
|
||||
sent: true,
|
||||
});
|
||||
} catch (err) {
|
||||
return ctx.badRequest(null, err);
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "strapi-plugin-users-permissions",
|
||||
"version": "3.0.0-beta.17.6",
|
||||
"version": "3.0.0-beta.17.8",
|
||||
"description": "Protect your API with a full-authentication process based on JWT",
|
||||
"strapi": {
|
||||
"name": "Roles & Permissions",
|
||||
@ -31,8 +31,8 @@
|
||||
"reactstrap": "^5.0.0",
|
||||
"redux-saga": "^0.16.0",
|
||||
"request": "^2.83.0",
|
||||
"strapi-helper-plugin": "3.0.0-beta.17.6",
|
||||
"strapi-utils": "3.0.0-beta.17.6",
|
||||
"strapi-helper-plugin": "3.0.0-beta.17.8",
|
||||
"strapi-utils": "3.0.0-beta.17.8",
|
||||
"uuid": "^3.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "strapi-provider-email-amazon-ses",
|
||||
"version": "3.0.0-beta.17.6",
|
||||
"version": "3.0.0-beta.17.8",
|
||||
"description": "Amazon SES provider for strapi email",
|
||||
"homepage": "http://strapi.io",
|
||||
"keywords": [
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "strapi-provider-email-mailgun",
|
||||
"version": "3.0.0-beta.17.6",
|
||||
"version": "3.0.0-beta.17.8",
|
||||
"description": "Mailgun provider for strapi email plugin",
|
||||
"homepage": "http://strapi.io",
|
||||
"keywords": [
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "strapi-provider-email-sendgrid",
|
||||
"version": "3.0.0-beta.17.6",
|
||||
"version": "3.0.0-beta.17.8",
|
||||
"description": "Sendgrid provider for strapi email",
|
||||
"homepage": "http://strapi.io",
|
||||
"keywords": [
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "strapi-provider-email-sendmail",
|
||||
"version": "3.0.0-beta.17.6",
|
||||
"version": "3.0.0-beta.17.8",
|
||||
"description": "Sendmail provider for strapi email",
|
||||
"homepage": "http://strapi.io",
|
||||
"keywords": [
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "strapi-provider-upload-aws-s3",
|
||||
"version": "3.0.0-beta.17.6",
|
||||
"version": "3.0.0-beta.17.8",
|
||||
"description": "AWS S3 provider for strapi upload",
|
||||
"homepage": "http://strapi.io",
|
||||
"keywords": [
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "strapi-provider-upload-cloudinary",
|
||||
"version": "3.0.0-beta.17.6",
|
||||
"version": "3.0.0-beta.17.8",
|
||||
"description": "Cloudinary provider for strapi upload",
|
||||
"homepage": "http://strapi.io",
|
||||
"keywords": [
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "strapi-provider-upload-local",
|
||||
"version": "3.0.0-beta.17.6",
|
||||
"version": "3.0.0-beta.17.8",
|
||||
"description": "Local provider for strapi upload",
|
||||
"homepage": "http://strapi.io",
|
||||
"keywords": [
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "strapi-provider-upload-rackspace",
|
||||
"version": "3.0.0-beta.17.6",
|
||||
"version": "3.0.0-beta.17.8",
|
||||
"description": "Rackspace provider for strapi upload",
|
||||
"main": "./lib",
|
||||
"keywords": [],
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "strapi-utils",
|
||||
"version": "3.0.0-beta.17.6",
|
||||
"version": "3.0.0-beta.17.8",
|
||||
"description": "Shared utilities for the Strapi packages",
|
||||
"homepage": "http://strapi.io",
|
||||
"keywords": [
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "strapi",
|
||||
"version": "3.0.0-beta.17.6",
|
||||
"version": "3.0.0-beta.17.8",
|
||||
"description": "An open source headless CMS solution to create and manage your own API. It provides a powerful dashboard and features to make your life easier. Databases supported: MongoDB, MySQL, MariaDB, PostgreSQL, SQLite",
|
||||
"homepage": "http://strapi.io",
|
||||
"directories": {
|
||||
@ -48,15 +48,15 @@
|
||||
"resolve-cwd": "^3.0.0",
|
||||
"rimraf": "^2.6.2",
|
||||
"shelljs": "^0.8.3",
|
||||
"strapi-generate": "3.0.0-beta.17.6",
|
||||
"strapi-generate-api": "3.0.0-beta.17.6",
|
||||
"strapi-generate-controller": "3.0.0-beta.17.6",
|
||||
"strapi-generate-model": "3.0.0-beta.17.6",
|
||||
"strapi-generate-new": "3.0.0-beta.17.6",
|
||||
"strapi-generate-plugin": "3.0.0-beta.17.6",
|
||||
"strapi-generate-policy": "3.0.0-beta.17.6",
|
||||
"strapi-generate-service": "3.0.0-beta.17.6",
|
||||
"strapi-utils": "3.0.0-beta.17.6"
|
||||
"strapi-generate": "3.0.0-beta.17.8",
|
||||
"strapi-generate-api": "3.0.0-beta.17.8",
|
||||
"strapi-generate-controller": "3.0.0-beta.17.8",
|
||||
"strapi-generate-model": "3.0.0-beta.17.8",
|
||||
"strapi-generate-new": "3.0.0-beta.17.8",
|
||||
"strapi-generate-plugin": "3.0.0-beta.17.8",
|
||||
"strapi-generate-policy": "3.0.0-beta.17.8",
|
||||
"strapi-generate-service": "3.0.0-beta.17.8",
|
||||
"strapi-utils": "3.0.0-beta.17.8"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "jest --verbose",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user