diff --git a/examples/kitchensink/package.json b/examples/kitchensink/package.json index 54c0cab74f..13e61afa2f 100644 --- a/examples/kitchensink/package.json +++ b/examples/kitchensink/package.json @@ -13,9 +13,6 @@ }, "dependencies": { "@strapi/admin": "4.0.0", - "@strapi/plugin-documentation": "4.0.0", - "@strapi/plugin-graphql": "4.0.0", - "@strapi/plugin-i18n": "4.0.0", "@strapi/provider-email-mailgun": "4.0.0", "@strapi/provider-upload-aws-s3": "4.0.0", "@strapi/provider-upload-cloudinary": "4.0.0", diff --git a/examples/kitchensink/src/admin/app.js b/examples/kitchensink/src/admin/app.example.js similarity index 100% rename from examples/kitchensink/src/admin/app.js rename to examples/kitchensink/src/admin/app.example.js diff --git a/examples/kitchensink/src/admin/webpack.config.js b/examples/kitchensink/src/admin/webpack.config.example.js similarity index 100% rename from examples/kitchensink/src/admin/webpack.config.js rename to examples/kitchensink/src/admin/webpack.config.example.js diff --git a/examples/kitchensink/src/extensions/documentation/documentation/1.0.0/full_documentation.json b/examples/kitchensink/src/extensions/documentation/documentation/1.0.0/full_documentation.json new file mode 100644 index 0000000000..34c902027e --- /dev/null +++ b/examples/kitchensink/src/extensions/documentation/documentation/1.0.0/full_documentation.json @@ -0,0 +1,3105 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "DOCUMENTATION", + "description": "", + "termsOfService": "YOUR_TERMS_OF_SERVICE_URL", + "contact": { + "name": "TEAM", + "email": "contact-email@something.io", + "url": "mywebsite.io" + }, + "license": { + "name": "Apache 2.0", + "url": "https://www.apache.org/licenses/LICENSE-2.0.html" + }, + "x-generation-date": "2021-12-20T13:15:30.797Z" + }, + "x-strapi-config": { + "path": "/documentation", + "showGeneratedFiles": true, + "generateDefaultResponse": true, + "plugins": [ + "email", + "upload" + ] + }, + "servers": [ + { + "url": "http://localhost:1337/api", + "description": "Development server" + } + ], + "externalDocs": { + "description": "Find out more", + "url": "https://docs.strapi.io/developer-docs/latest/getting-started/introduction.html" + }, + "security": [ + { + "bearerAuth": [] + } + ], + "components": { + "securitySchemes": { + "bearerAuth": { + "type": "http", + "scheme": "bearer", + "bearerFormat": "JWT" + } + } + }, + "paths": { + "/email": { + "post": { + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": { + "foo": { + "type": "string" + } + } + } + } + }, + "meta": { + "type": "object" + } + } + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "properties": { + "status": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + } + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "properties": { + "status": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + } + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "properties": { + "status": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + } + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "properties": { + "status": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + } + } + } + } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "properties": { + "status": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + } + } + } + } + } + }, + "tags": [ + "Email" + ], + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "object", + "properties": { + "foo": { + "type": "string" + } + } + } + } + } + } + } + } + } + }, + "/email/test": { + "post": { + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": { + "foo": { + "type": "string" + } + } + } + } + }, + "meta": { + "type": "object" + } + } + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "properties": { + "status": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + } + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "properties": { + "status": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + } + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "properties": { + "status": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + } + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "properties": { + "status": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + } + } + } + } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "properties": { + "status": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + } + } + } + } + } + }, + "tags": [ + "Email" + ], + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "object", + "properties": { + "foo": { + "type": "string" + } + } + } + } + } + } + } + } + } + }, + "/email/settings": { + "get": { + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": { + "foo": { + "type": "string" + } + } + } + } + }, + "meta": { + "type": "object" + } + } + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "properties": { + "status": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + } + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "properties": { + "status": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + } + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "properties": { + "status": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + } + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "properties": { + "status": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + } + } + } + } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "properties": { + "status": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + } + } + } + } + } + }, + "tags": [ + "Email" + ], + "parameters": [], + "requestBody": {} + } + }, + "/upload": { + "post": { + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "alternativeText": { + "type": "string" + }, + "caption": { + "type": "string" + }, + "width": { + "type": "integer" + }, + "height": { + "type": "integer" + }, + "formats": {}, + "hash": { + "type": "string" + }, + "ext": { + "type": "string" + }, + "mime": { + "type": "string" + }, + "size": { + "type": "number", + "format": "float" + }, + "url": { + "type": "string" + }, + "previewUrl": { + "type": "string" + }, + "provider": { + "type": "string" + }, + "provider_metadata": {}, + "related": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": {} + } + } + } + } + } + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "updatedAt": { + "type": "string", + "format": "date-time" + }, + "createdBy": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": { + "firstname": { + "type": "string" + }, + "lastname": { + "type": "string" + }, + "username": { + "type": "string" + }, + "email": { + "type": "string", + "format": "email" + }, + "resetPasswordToken": { + "type": "string" + }, + "registrationToken": { + "type": "string" + }, + "isActive": { + "type": "boolean" + }, + "roles": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "code": { + "type": "string" + }, + "description": { + "type": "string" + }, + "users": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": {} + } + } + } + } + } + }, + "permissions": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": { + "action": { + "type": "string" + }, + "subject": { + "type": "string" + }, + "properties": {}, + "conditions": {}, + "role": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": {} + } + } + } + } + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "updatedAt": { + "type": "string", + "format": "date-time" + }, + "createdBy": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": {} + } + } + } + } + }, + "updatedBy": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": {} + } + } + } + } + } + } + } + } + } + } + } + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "updatedAt": { + "type": "string", + "format": "date-time" + }, + "createdBy": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": {} + } + } + } + } + }, + "updatedBy": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": {} + } + } + } + } + } + } + } + } + } + } + } + }, + "blocked": { + "type": "boolean" + }, + "preferedLanguage": { + "type": "string" + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "updatedAt": { + "type": "string", + "format": "date-time" + }, + "createdBy": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": {} + } + } + } + } + }, + "updatedBy": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": {} + } + } + } + } + } + } + } + } + } + } + }, + "updatedBy": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": {} + } + } + } + } + } + } + } + } + }, + "meta": { + "type": "object" + } + } + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "properties": { + "status": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + } + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "properties": { + "status": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + } + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "properties": { + "status": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + } + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "properties": { + "status": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + } + } + } + } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "properties": { + "status": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + } + } + } + } + } + }, + "tags": [ + "Upload - file" + ], + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "hash": { + "type": "string" + }, + "mime": { + "type": "string" + }, + "size": { + "type": "number", + "format": "float" + }, + "url": { + "type": "string" + }, + "provider": { + "type": "string" + } + } + } + } + } + } + } + } + } + }, + "/upload/files/count": { + "get": { + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "alternativeText": { + "type": "string" + }, + "caption": { + "type": "string" + }, + "width": { + "type": "integer" + }, + "height": { + "type": "integer" + }, + "formats": {}, + "hash": { + "type": "string" + }, + "ext": { + "type": "string" + }, + "mime": { + "type": "string" + }, + "size": { + "type": "number", + "format": "float" + }, + "url": { + "type": "string" + }, + "previewUrl": { + "type": "string" + }, + "provider": { + "type": "string" + }, + "provider_metadata": {}, + "related": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": {} + } + } + } + } + } + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "updatedAt": { + "type": "string", + "format": "date-time" + }, + "createdBy": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": { + "firstname": { + "type": "string" + }, + "lastname": { + "type": "string" + }, + "username": { + "type": "string" + }, + "email": { + "type": "string", + "format": "email" + }, + "resetPasswordToken": { + "type": "string" + }, + "registrationToken": { + "type": "string" + }, + "isActive": { + "type": "boolean" + }, + "roles": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "code": { + "type": "string" + }, + "description": { + "type": "string" + }, + "users": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": {} + } + } + } + } + } + }, + "permissions": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": { + "action": { + "type": "string" + }, + "subject": { + "type": "string" + }, + "properties": {}, + "conditions": {}, + "role": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": {} + } + } + } + } + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "updatedAt": { + "type": "string", + "format": "date-time" + }, + "createdBy": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": {} + } + } + } + } + }, + "updatedBy": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": {} + } + } + } + } + } + } + } + } + } + } + } + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "updatedAt": { + "type": "string", + "format": "date-time" + }, + "createdBy": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": {} + } + } + } + } + }, + "updatedBy": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": {} + } + } + } + } + } + } + } + } + } + } + } + }, + "blocked": { + "type": "boolean" + }, + "preferedLanguage": { + "type": "string" + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "updatedAt": { + "type": "string", + "format": "date-time" + }, + "createdBy": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": {} + } + } + } + } + }, + "updatedBy": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": {} + } + } + } + } + } + } + } + } + } + } + }, + "updatedBy": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": {} + } + } + } + } + } + } + } + } + }, + "meta": { + "type": "object" + } + } + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "properties": { + "status": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + } + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "properties": { + "status": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + } + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "properties": { + "status": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + } + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "properties": { + "status": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + } + } + } + } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "properties": { + "status": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + } + } + } + } + } + }, + "tags": [ + "Upload - file" + ], + "parameters": [], + "requestBody": {} + } + }, + "/upload/files": { + "get": { + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "alternativeText": { + "type": "string" + }, + "caption": { + "type": "string" + }, + "width": { + "type": "integer" + }, + "height": { + "type": "integer" + }, + "formats": {}, + "hash": { + "type": "string" + }, + "ext": { + "type": "string" + }, + "mime": { + "type": "string" + }, + "size": { + "type": "number", + "format": "float" + }, + "url": { + "type": "string" + }, + "previewUrl": { + "type": "string" + }, + "provider": { + "type": "string" + }, + "provider_metadata": {}, + "related": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": {} + } + } + } + } + } + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "updatedAt": { + "type": "string", + "format": "date-time" + }, + "createdBy": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": { + "firstname": { + "type": "string" + }, + "lastname": { + "type": "string" + }, + "username": { + "type": "string" + }, + "email": { + "type": "string", + "format": "email" + }, + "resetPasswordToken": { + "type": "string" + }, + "registrationToken": { + "type": "string" + }, + "isActive": { + "type": "boolean" + }, + "roles": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "code": { + "type": "string" + }, + "description": { + "type": "string" + }, + "users": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": {} + } + } + } + } + } + }, + "permissions": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": { + "action": { + "type": "string" + }, + "subject": { + "type": "string" + }, + "properties": {}, + "conditions": {}, + "role": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": {} + } + } + } + } + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "updatedAt": { + "type": "string", + "format": "date-time" + }, + "createdBy": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": {} + } + } + } + } + }, + "updatedBy": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": {} + } + } + } + } + } + } + } + } + } + } + } + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "updatedAt": { + "type": "string", + "format": "date-time" + }, + "createdBy": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": {} + } + } + } + } + }, + "updatedBy": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": {} + } + } + } + } + } + } + } + } + } + } + } + }, + "blocked": { + "type": "boolean" + }, + "preferedLanguage": { + "type": "string" + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "updatedAt": { + "type": "string", + "format": "date-time" + }, + "createdBy": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": {} + } + } + } + } + }, + "updatedBy": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": {} + } + } + } + } + } + } + } + } + } + } + }, + "updatedBy": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": {} + } + } + } + } + } + } + } + } + } + }, + "meta": { + "type": "object", + "properties": { + "pagination": { + "properties": { + "page": { + "type": "integer" + }, + "pageSize": { + "type": "integer", + "minimum": 25 + }, + "pageCount": { + "type": "integer", + "maximum": 1 + }, + "total": { + "type": "integer" + } + } + } + } + } + } + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "properties": { + "status": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + } + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "properties": { + "status": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + } + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "properties": { + "status": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + } + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "properties": { + "status": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + } + } + } + } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "properties": { + "status": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + } + } + } + } + } + }, + "tags": [ + "Upload - file" + ], + "parameters": [ + { + "name": "sort", + "in": "query", + "description": "Sort by attributes ascending (asc) or descending (desc)", + "deprecated": false, + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "pagination[withCount]", + "in": "query", + "description": "Retun page/pageSize (default: true)", + "deprecated": false, + "required": false, + "schema": { + "type": "boolean" + } + }, + { + "name": "pagination[page]", + "in": "query", + "description": "Page number (default: 0)", + "deprecated": false, + "required": false, + "schema": { + "type": "integer" + } + }, + { + "name": "pagination[pageSize]", + "in": "query", + "description": "Page size (default: 25)", + "deprecated": false, + "required": false, + "schema": { + "type": "integer" + } + }, + { + "name": "pagination[start]", + "in": "query", + "description": "Offset value (default: 0)", + "deprecated": false, + "required": false, + "schema": { + "type": "integer" + } + }, + { + "name": "pagination[limit]", + "in": "query", + "description": "Number of entities to return (default: 25)", + "deprecated": false, + "required": false, + "schema": { + "type": "integer" + } + }, + { + "name": "fields", + "in": "query", + "description": "Fields to return (ex: title,author)", + "deprecated": false, + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "populate", + "in": "query", + "description": "Relations to return", + "deprecated": false, + "required": false, + "schema": { + "type": "string" + } + } + ], + "requestBody": {} + } + }, + "/upload/files/{id}": { + "get": { + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "alternativeText": { + "type": "string" + }, + "caption": { + "type": "string" + }, + "width": { + "type": "integer" + }, + "height": { + "type": "integer" + }, + "formats": {}, + "hash": { + "type": "string" + }, + "ext": { + "type": "string" + }, + "mime": { + "type": "string" + }, + "size": { + "type": "number", + "format": "float" + }, + "url": { + "type": "string" + }, + "previewUrl": { + "type": "string" + }, + "provider": { + "type": "string" + }, + "provider_metadata": {}, + "related": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": {} + } + } + } + } + } + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "updatedAt": { + "type": "string", + "format": "date-time" + }, + "createdBy": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": { + "firstname": { + "type": "string" + }, + "lastname": { + "type": "string" + }, + "username": { + "type": "string" + }, + "email": { + "type": "string", + "format": "email" + }, + "resetPasswordToken": { + "type": "string" + }, + "registrationToken": { + "type": "string" + }, + "isActive": { + "type": "boolean" + }, + "roles": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "code": { + "type": "string" + }, + "description": { + "type": "string" + }, + "users": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": {} + } + } + } + } + } + }, + "permissions": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": { + "action": { + "type": "string" + }, + "subject": { + "type": "string" + }, + "properties": {}, + "conditions": {}, + "role": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": {} + } + } + } + } + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "updatedAt": { + "type": "string", + "format": "date-time" + }, + "createdBy": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": {} + } + } + } + } + }, + "updatedBy": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": {} + } + } + } + } + } + } + } + } + } + } + } + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "updatedAt": { + "type": "string", + "format": "date-time" + }, + "createdBy": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": {} + } + } + } + } + }, + "updatedBy": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": {} + } + } + } + } + } + } + } + } + } + } + } + }, + "blocked": { + "type": "boolean" + }, + "preferedLanguage": { + "type": "string" + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "updatedAt": { + "type": "string", + "format": "date-time" + }, + "createdBy": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": {} + } + } + } + } + }, + "updatedBy": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": {} + } + } + } + } + } + } + } + } + } + } + }, + "updatedBy": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": {} + } + } + } + } + } + } + } + } + }, + "meta": { + "type": "object" + } + } + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "properties": { + "status": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + } + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "properties": { + "status": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + } + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "properties": { + "status": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + } + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "properties": { + "status": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + } + } + } + } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "properties": { + "status": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + } + } + } + } + } + }, + "tags": [ + "Upload - file" + ], + "parameters": [ + { + "name": "id", + "in": "path", + "description": "", + "deprecated": false, + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": {} + }, + "delete": { + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "type": "integer", + "format": "int64" + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "properties": { + "status": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + } + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "properties": { + "status": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + } + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "properties": { + "status": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + } + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "properties": { + "status": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + } + } + } + } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "properties": { + "status": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + } + } + } + } + } + }, + "tags": [ + "Upload - file" + ], + "parameters": [ + { + "name": "id", + "in": "path", + "description": "", + "deprecated": false, + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": {} + } + } + } +} diff --git a/examples/kitchensink/src/extensions/email/documentation/1.0.0/email.json b/examples/kitchensink/src/extensions/email/documentation/1.0.0/email.json new file mode 100644 index 0000000000..6f966ef68f --- /dev/null +++ b/examples/kitchensink/src/extensions/email/documentation/1.0.0/email.json @@ -0,0 +1,595 @@ +{ + "paths": { + "/email": { + "post": { + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": { + "foo": { + "type": "string" + } + } + } + } + }, + "meta": { + "type": "object" + } + } + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "properties": { + "status": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + } + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "properties": { + "status": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + } + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "properties": { + "status": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + } + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "properties": { + "status": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + } + } + } + } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "properties": { + "status": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + } + } + } + } + } + }, + "tags": [ + "Email" + ], + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "object", + "properties": { + "foo": { + "type": "string" + } + } + } + } + } + } + } + } + } + }, + "/email/test": { + "post": { + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": { + "foo": { + "type": "string" + } + } + } + } + }, + "meta": { + "type": "object" + } + } + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "properties": { + "status": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + } + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "properties": { + "status": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + } + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "properties": { + "status": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + } + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "properties": { + "status": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + } + } + } + } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "properties": { + "status": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + } + } + } + } + } + }, + "tags": [ + "Email" + ], + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "object", + "properties": { + "foo": { + "type": "string" + } + } + } + } + } + } + } + } + } + }, + "/email/settings": { + "get": { + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": { + "foo": { + "type": "string" + } + } + } + } + }, + "meta": { + "type": "object" + } + } + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "properties": { + "status": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + } + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "properties": { + "status": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + } + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "properties": { + "status": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + } + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "properties": { + "status": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + } + } + } + } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "properties": { + "status": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + } + } + } + } + } + }, + "tags": [ + "Email" + ], + "parameters": [], + "requestBody": {} + } + } + } +} diff --git a/examples/kitchensink/src/extensions/upload/documentation/1.0.0/upload.json b/examples/kitchensink/src/extensions/upload/documentation/1.0.0/upload.json new file mode 100644 index 0000000000..e8cdc4c17a --- /dev/null +++ b/examples/kitchensink/src/extensions/upload/documentation/1.0.0/upload.json @@ -0,0 +1,2464 @@ +{ + "paths": { + "/upload": { + "post": { + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "alternativeText": { + "type": "string" + }, + "caption": { + "type": "string" + }, + "width": { + "type": "integer" + }, + "height": { + "type": "integer" + }, + "formats": {}, + "hash": { + "type": "string" + }, + "ext": { + "type": "string" + }, + "mime": { + "type": "string" + }, + "size": { + "type": "number", + "format": "float" + }, + "url": { + "type": "string" + }, + "previewUrl": { + "type": "string" + }, + "provider": { + "type": "string" + }, + "provider_metadata": {}, + "related": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": {} + } + } + } + } + } + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "updatedAt": { + "type": "string", + "format": "date-time" + }, + "createdBy": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": { + "firstname": { + "type": "string" + }, + "lastname": { + "type": "string" + }, + "username": { + "type": "string" + }, + "email": { + "type": "string", + "format": "email" + }, + "resetPasswordToken": { + "type": "string" + }, + "registrationToken": { + "type": "string" + }, + "isActive": { + "type": "boolean" + }, + "roles": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "code": { + "type": "string" + }, + "description": { + "type": "string" + }, + "users": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": {} + } + } + } + } + } + }, + "permissions": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": { + "action": { + "type": "string" + }, + "subject": { + "type": "string" + }, + "properties": {}, + "conditions": {}, + "role": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": {} + } + } + } + } + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "updatedAt": { + "type": "string", + "format": "date-time" + }, + "createdBy": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": {} + } + } + } + } + }, + "updatedBy": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": {} + } + } + } + } + } + } + } + } + } + } + } + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "updatedAt": { + "type": "string", + "format": "date-time" + }, + "createdBy": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": {} + } + } + } + } + }, + "updatedBy": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": {} + } + } + } + } + } + } + } + } + } + } + } + }, + "blocked": { + "type": "boolean" + }, + "preferedLanguage": { + "type": "string" + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "updatedAt": { + "type": "string", + "format": "date-time" + }, + "createdBy": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": {} + } + } + } + } + }, + "updatedBy": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": {} + } + } + } + } + } + } + } + } + } + } + }, + "updatedBy": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": {} + } + } + } + } + } + } + } + } + }, + "meta": { + "type": "object" + } + } + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "properties": { + "status": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + } + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "properties": { + "status": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + } + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "properties": { + "status": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + } + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "properties": { + "status": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + } + } + } + } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "properties": { + "status": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + } + } + } + } + } + }, + "tags": [ + "Upload - file" + ], + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "hash": { + "type": "string" + }, + "mime": { + "type": "string" + }, + "size": { + "type": "number", + "format": "float" + }, + "url": { + "type": "string" + }, + "provider": { + "type": "string" + } + } + } + } + } + } + } + } + } + }, + "/upload/files/count": { + "get": { + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "alternativeText": { + "type": "string" + }, + "caption": { + "type": "string" + }, + "width": { + "type": "integer" + }, + "height": { + "type": "integer" + }, + "formats": {}, + "hash": { + "type": "string" + }, + "ext": { + "type": "string" + }, + "mime": { + "type": "string" + }, + "size": { + "type": "number", + "format": "float" + }, + "url": { + "type": "string" + }, + "previewUrl": { + "type": "string" + }, + "provider": { + "type": "string" + }, + "provider_metadata": {}, + "related": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": {} + } + } + } + } + } + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "updatedAt": { + "type": "string", + "format": "date-time" + }, + "createdBy": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": { + "firstname": { + "type": "string" + }, + "lastname": { + "type": "string" + }, + "username": { + "type": "string" + }, + "email": { + "type": "string", + "format": "email" + }, + "resetPasswordToken": { + "type": "string" + }, + "registrationToken": { + "type": "string" + }, + "isActive": { + "type": "boolean" + }, + "roles": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "code": { + "type": "string" + }, + "description": { + "type": "string" + }, + "users": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": {} + } + } + } + } + } + }, + "permissions": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": { + "action": { + "type": "string" + }, + "subject": { + "type": "string" + }, + "properties": {}, + "conditions": {}, + "role": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": {} + } + } + } + } + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "updatedAt": { + "type": "string", + "format": "date-time" + }, + "createdBy": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": {} + } + } + } + } + }, + "updatedBy": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": {} + } + } + } + } + } + } + } + } + } + } + } + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "updatedAt": { + "type": "string", + "format": "date-time" + }, + "createdBy": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": {} + } + } + } + } + }, + "updatedBy": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": {} + } + } + } + } + } + } + } + } + } + } + } + }, + "blocked": { + "type": "boolean" + }, + "preferedLanguage": { + "type": "string" + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "updatedAt": { + "type": "string", + "format": "date-time" + }, + "createdBy": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": {} + } + } + } + } + }, + "updatedBy": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": {} + } + } + } + } + } + } + } + } + } + } + }, + "updatedBy": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": {} + } + } + } + } + } + } + } + } + }, + "meta": { + "type": "object" + } + } + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "properties": { + "status": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + } + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "properties": { + "status": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + } + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "properties": { + "status": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + } + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "properties": { + "status": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + } + } + } + } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "properties": { + "status": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + } + } + } + } + } + }, + "tags": [ + "Upload - file" + ], + "parameters": [], + "requestBody": {} + } + }, + "/upload/files": { + "get": { + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "alternativeText": { + "type": "string" + }, + "caption": { + "type": "string" + }, + "width": { + "type": "integer" + }, + "height": { + "type": "integer" + }, + "formats": {}, + "hash": { + "type": "string" + }, + "ext": { + "type": "string" + }, + "mime": { + "type": "string" + }, + "size": { + "type": "number", + "format": "float" + }, + "url": { + "type": "string" + }, + "previewUrl": { + "type": "string" + }, + "provider": { + "type": "string" + }, + "provider_metadata": {}, + "related": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": {} + } + } + } + } + } + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "updatedAt": { + "type": "string", + "format": "date-time" + }, + "createdBy": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": { + "firstname": { + "type": "string" + }, + "lastname": { + "type": "string" + }, + "username": { + "type": "string" + }, + "email": { + "type": "string", + "format": "email" + }, + "resetPasswordToken": { + "type": "string" + }, + "registrationToken": { + "type": "string" + }, + "isActive": { + "type": "boolean" + }, + "roles": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "code": { + "type": "string" + }, + "description": { + "type": "string" + }, + "users": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": {} + } + } + } + } + } + }, + "permissions": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": { + "action": { + "type": "string" + }, + "subject": { + "type": "string" + }, + "properties": {}, + "conditions": {}, + "role": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": {} + } + } + } + } + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "updatedAt": { + "type": "string", + "format": "date-time" + }, + "createdBy": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": {} + } + } + } + } + }, + "updatedBy": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": {} + } + } + } + } + } + } + } + } + } + } + } + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "updatedAt": { + "type": "string", + "format": "date-time" + }, + "createdBy": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": {} + } + } + } + } + }, + "updatedBy": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": {} + } + } + } + } + } + } + } + } + } + } + } + }, + "blocked": { + "type": "boolean" + }, + "preferedLanguage": { + "type": "string" + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "updatedAt": { + "type": "string", + "format": "date-time" + }, + "createdBy": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": {} + } + } + } + } + }, + "updatedBy": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": {} + } + } + } + } + } + } + } + } + } + } + }, + "updatedBy": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": {} + } + } + } + } + } + } + } + } + } + }, + "meta": { + "type": "object", + "properties": { + "pagination": { + "properties": { + "page": { + "type": "integer" + }, + "pageSize": { + "type": "integer", + "minimum": 25 + }, + "pageCount": { + "type": "integer", + "maximum": 1 + }, + "total": { + "type": "integer" + } + } + } + } + } + } + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "properties": { + "status": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + } + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "properties": { + "status": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + } + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "properties": { + "status": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + } + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "properties": { + "status": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + } + } + } + } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "properties": { + "status": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + } + } + } + } + } + }, + "tags": [ + "Upload - file" + ], + "parameters": [ + { + "name": "sort", + "in": "query", + "description": "Sort by attributes ascending (asc) or descending (desc)", + "deprecated": false, + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "pagination[withCount]", + "in": "query", + "description": "Retun page/pageSize (default: true)", + "deprecated": false, + "required": false, + "schema": { + "type": "boolean" + } + }, + { + "name": "pagination[page]", + "in": "query", + "description": "Page number (default: 0)", + "deprecated": false, + "required": false, + "schema": { + "type": "integer" + } + }, + { + "name": "pagination[pageSize]", + "in": "query", + "description": "Page size (default: 25)", + "deprecated": false, + "required": false, + "schema": { + "type": "integer" + } + }, + { + "name": "pagination[start]", + "in": "query", + "description": "Offset value (default: 0)", + "deprecated": false, + "required": false, + "schema": { + "type": "integer" + } + }, + { + "name": "pagination[limit]", + "in": "query", + "description": "Number of entities to return (default: 25)", + "deprecated": false, + "required": false, + "schema": { + "type": "integer" + } + }, + { + "name": "fields", + "in": "query", + "description": "Fields to return (ex: title,author)", + "deprecated": false, + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "populate", + "in": "query", + "description": "Relations to return", + "deprecated": false, + "required": false, + "schema": { + "type": "string" + } + } + ], + "requestBody": {} + } + }, + "/upload/files/{id}": { + "get": { + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "alternativeText": { + "type": "string" + }, + "caption": { + "type": "string" + }, + "width": { + "type": "integer" + }, + "height": { + "type": "integer" + }, + "formats": {}, + "hash": { + "type": "string" + }, + "ext": { + "type": "string" + }, + "mime": { + "type": "string" + }, + "size": { + "type": "number", + "format": "float" + }, + "url": { + "type": "string" + }, + "previewUrl": { + "type": "string" + }, + "provider": { + "type": "string" + }, + "provider_metadata": {}, + "related": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": {} + } + } + } + } + } + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "updatedAt": { + "type": "string", + "format": "date-time" + }, + "createdBy": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": { + "firstname": { + "type": "string" + }, + "lastname": { + "type": "string" + }, + "username": { + "type": "string" + }, + "email": { + "type": "string", + "format": "email" + }, + "resetPasswordToken": { + "type": "string" + }, + "registrationToken": { + "type": "string" + }, + "isActive": { + "type": "boolean" + }, + "roles": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "code": { + "type": "string" + }, + "description": { + "type": "string" + }, + "users": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": {} + } + } + } + } + } + }, + "permissions": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": { + "action": { + "type": "string" + }, + "subject": { + "type": "string" + }, + "properties": {}, + "conditions": {}, + "role": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": {} + } + } + } + } + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "updatedAt": { + "type": "string", + "format": "date-time" + }, + "createdBy": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": {} + } + } + } + } + }, + "updatedBy": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": {} + } + } + } + } + } + } + } + } + } + } + } + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "updatedAt": { + "type": "string", + "format": "date-time" + }, + "createdBy": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": {} + } + } + } + } + }, + "updatedBy": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": {} + } + } + } + } + } + } + } + } + } + } + } + }, + "blocked": { + "type": "boolean" + }, + "preferedLanguage": { + "type": "string" + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "updatedAt": { + "type": "string", + "format": "date-time" + }, + "createdBy": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": {} + } + } + } + } + }, + "updatedBy": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": {} + } + } + } + } + } + } + } + } + } + } + }, + "updatedBy": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributes": { + "type": "object", + "properties": {} + } + } + } + } + } + } + } + } + }, + "meta": { + "type": "object" + } + } + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "properties": { + "status": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + } + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "properties": { + "status": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + } + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "properties": { + "status": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + } + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "properties": { + "status": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + } + } + } + } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "properties": { + "status": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + } + } + } + } + } + }, + "tags": [ + "Upload - file" + ], + "parameters": [ + { + "name": "id", + "in": "path", + "description": "", + "deprecated": false, + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": {} + }, + "delete": { + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "type": "integer", + "format": "int64" + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "properties": { + "status": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + } + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "properties": { + "status": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + } + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "properties": { + "status": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + } + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "properties": { + "status": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + } + } + } + } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "properties": { + "status": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + } + } + } + } + } + }, + "tags": [ + "Upload - file" + ], + "parameters": [ + { + "name": "id", + "in": "path", + "description": "", + "deprecated": false, + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": {} + } + } + } +} diff --git a/packages/core/admin/index.js b/packages/core/admin/index.js index 28bae7441d..95abffd2b7 100644 --- a/packages/core/admin/index.js +++ b/packages/core/admin/index.js @@ -43,9 +43,10 @@ function getCustomWebpackConfig(dir, config) { return webpackConfig; } -async function build({ plugins, dir, env, options, optimize }) { +async function build({ plugins, dir, env, options, optimize, useDefaultBuild }) { const buildAdmin = await shouldBuildAdmin({ dir, plugins }); - if (!buildAdmin) { + + if (!buildAdmin && useDefaultBuild) { return; } @@ -319,15 +320,14 @@ async function watchFiles(dir) { } const hasCustomAdminCode = async dir => { - const customAdminPath = path.join(dir, 'src/admin'); + const customAdminPath = path.join(dir, 'src', 'admin'); + const customAdminConfigFile = path.join(customAdminPath, 'app.js'); + const customAdminWebpackFile = path.join(customAdminPath, 'webpack.config.js'); - if (!(await fs.pathExists(customAdminPath))) { - return false; - } + const hasCustomConfigFile = await fs.pathExists(customAdminConfigFile); + const hasCustomWebpackFile = await fs.pathExists(customAdminWebpackFile); - const files = await fs.readdir(customAdminPath); - - return files.length > 0; + return hasCustomConfigFile || hasCustomWebpackFile; }; const hasNonDefaultPlugins = plugins => { diff --git a/packages/core/strapi/bin/strapi.js b/packages/core/strapi/bin/strapi.js index fc96e37f14..32b4f0af18 100755 --- a/packages/core/strapi/bin/strapi.js +++ b/packages/core/strapi/bin/strapi.js @@ -133,6 +133,7 @@ program program .command('build') + .option('--use-default-build', 'Use the default build of the admin panel', false) .option('--clean', 'Remove the build and .cache folders', false) .option('--no-optimization', 'Build the Administration without assets optimization') .description('Builds the strapi admin app') diff --git a/packages/core/strapi/lib/commands/build.js b/packages/core/strapi/lib/commands/build.js index e4a2c065de..36e6e17036 100644 --- a/packages/core/strapi/lib/commands/build.js +++ b/packages/core/strapi/lib/commands/build.js @@ -12,7 +12,7 @@ const getEnabledPlugins = require('../core/loaders/plugins/get-enabled-plugins') /** * `$ strapi build` */ -module.exports = async ({ clean, optimization }) => { +module.exports = async ({ clean, optimization, useDefaultBuild }) => { const dir = process.cwd(); const strapiInstance = strapi({ @@ -36,6 +36,7 @@ module.exports = async ({ clean, optimization }) => { return strapiAdmin .build({ + useDefaultBuild, dir, plugins, // front end build env is always production for now @@ -47,6 +48,8 @@ module.exports = async ({ clean, optimization }) => { }, }) .then(() => { + console.log('Admin UI build successfully'); + process.exit(); }) .catch(err => { diff --git a/packages/core/strapi/lib/commands/develop.js b/packages/core/strapi/lib/commands/develop.js index c6766bd1d0..949b275861 100644 --- a/packages/core/strapi/lib/commands/develop.js +++ b/packages/core/strapi/lib/commands/develop.js @@ -15,7 +15,7 @@ const strapi = require('../index'); * `$ strapi develop` * */ -module.exports = async function ({ build, watchAdmin, polling, browser }) { +module.exports = async function({ build, watchAdmin, polling, browser }) { const dir = process.cwd(); const config = loadConfiguration(dir); const logger = createLogger(config.logger, {}); @@ -28,7 +28,7 @@ module.exports = async function ({ build, watchAdmin, polling, browser }) { // Don't run the build process if the admin is in watch mode if (build && !watchAdmin && serveAdminPanel && !buildExists) { try { - execa.sync('npm run -s build -- --no-optimization', { + execa.sync('npm run -s build -- --no-optimization --use-default-build', { stdio: 'inherit', shell: true, }); @@ -81,7 +81,7 @@ module.exports = async function ({ build, watchAdmin, polling, browser }) { polling, }); - process.on('message', async (message) => { + process.on('message', async message => { switch (message) { case 'kill': await strapiInstance.destroy(); @@ -140,15 +140,15 @@ function watchFileChanges({ dir, strapiInstance, watchIgnoreFiles, polling }) { }); watcher - .on('add', (path) => { + .on('add', path => { strapiInstance.log.info(`File created: ${path}`); restart(); }) - .on('change', (path) => { + .on('change', path => { strapiInstance.log.info(`File changed: ${path}`); restart(); }) - .on('unlink', (path) => { + .on('unlink', path => { strapiInstance.log.info(`File deleted: ${path}`); restart(); }); diff --git a/packages/generators/app/lib/resources/files/src/admin/app.js b/packages/generators/app/lib/resources/files/src/admin/app.example.js similarity index 87% rename from packages/generators/app/lib/resources/files/src/admin/app.js rename to packages/generators/app/lib/resources/files/src/admin/app.example.js index b3cd83fe1f..7316221f10 100644 --- a/packages/generators/app/lib/resources/files/src/admin/app.js +++ b/packages/generators/app/lib/resources/files/src/admin/app.example.js @@ -2,7 +2,7 @@ export default { config: { locales: [ // 'ar', - 'fr', + // 'fr', // 'cs', // 'de', // 'dk', @@ -29,5 +29,7 @@ export default { // 'zh', ], }, - bootstrap() {}, + bootstrap(app) { + console.log(app); + }, }; diff --git a/packages/generators/app/lib/resources/files/src/admin/webpack.config.js b/packages/generators/app/lib/resources/files/src/admin/webpack.config.example.js similarity index 100% rename from packages/generators/app/lib/resources/files/src/admin/webpack.config.js rename to packages/generators/app/lib/resources/files/src/admin/webpack.config.example.js