├── .editorconfig ├── .env.example ├── .eslintignore ├── .eslintrc ├── .gitignore ├── README.md ├── api ├── .gitkeep ├── article │ ├── config │ │ └── routes.json │ ├── controllers │ │ └── article.js │ ├── documentation │ │ └── 1.0.0 │ │ │ └── article.json │ ├── models │ │ ├── article.js │ │ └── article.settings.json │ └── services │ │ └── article.js └── category │ ├── config │ └── routes.json │ ├── controllers │ └── category.js │ ├── documentation │ └── 1.0.0 │ │ └── category.json │ ├── models │ ├── category.js │ └── category.settings.json │ └── services │ └── category.js ├── app.json ├── config ├── env │ ├── development │ │ ├── database.js │ │ └── plugins.js │ └── production │ │ ├── database.js │ │ └── plugins.js ├── functions │ ├── bootstrap.js │ ├── cron.js │ └── responses │ │ └── 404.js └── server.js ├── extensions ├── .gitkeep ├── documentation │ └── documentation │ │ └── 1.0.0 │ │ └── full_documentation.json ├── email │ └── documentation │ │ └── 1.0.0 │ │ └── email-Email.json ├── upload │ └── documentation │ │ └── 1.0.0 │ │ └── upload-File.json └── users-permissions │ ├── config │ └── jwt.js │ ├── documentation │ └── 1.0.0 │ │ ├── users-permissions-Role.json │ │ └── users-permissions-User.json │ └── models │ └── User.settings.json ├── favicon.ico ├── package.json └── public ├── robots.txt └── uploads └── .gitkeep /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = space 5 | indent_size = 2 6 | end_of_line = lf 7 | charset = utf-8 8 | trim_trailing_whitespace = true 9 | insert_final_newline = true 10 | 11 | [{package.json,*.yml}] 12 | indent_style = space 13 | indent_size = 2 14 | 15 | [*.md] 16 | trim_trailing_whitespace = false 17 | -------------------------------------------------------------------------------- /.env.example: -------------------------------------------------------------------------------- 1 | HOST=0.0.0.0 2 | PORT=1337 3 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | .cache 2 | build 3 | **/node_modules/** 4 | -------------------------------------------------------------------------------- /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "parser": "babel-eslint", 3 | "extends": "eslint:recommended", 4 | "env": { 5 | "commonjs": true, 6 | "es6": true, 7 | "node": true, 8 | "browser": false 9 | }, 10 | "parserOptions": { 11 | "ecmaFeatures": { 12 | "experimentalObjectRestSpread": true, 13 | "jsx": false 14 | }, 15 | "sourceType": "module" 16 | }, 17 | "globals": { 18 | "strapi": true 19 | }, 20 | "rules": { 21 | "indent": ["error", 2, { "SwitchCase": 1 }], 22 | "linebreak-style": ["error", "unix"], 23 | "no-console": 0, 24 | "quotes": ["error", "single"], 25 | "semi": ["error", "always"] 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ############################ 2 | # OS X 3 | ############################ 4 | 5 | .DS_Store 6 | .AppleDouble 7 | .LSOverride 8 | Icon 9 | .Spotlight-V100 10 | .Trashes 11 | ._* 12 | 13 | 14 | ############################ 15 | # Linux 16 | ############################ 17 | 18 | *~ 19 | 20 | 21 | ############################ 22 | # Windows 23 | ############################ 24 | 25 | Thumbs.db 26 | ehthumbs.db 27 | Desktop.ini 28 | $RECYCLE.BIN/ 29 | *.cab 30 | *.msi 31 | *.msm 32 | *.msp 33 | 34 | 35 | ############################ 36 | # Packages 37 | ############################ 38 | 39 | *.7z 40 | *.csv 41 | *.dat 42 | *.dmg 43 | *.gz 44 | *.iso 45 | *.jar 46 | *.rar 47 | *.tar 48 | *.zip 49 | *.com 50 | *.class 51 | *.dll 52 | *.exe 53 | *.o 54 | *.seed 55 | *.so 56 | *.swo 57 | *.swp 58 | *.swn 59 | *.swm 60 | *.out 61 | *.pid 62 | 63 | 64 | ############################ 65 | # Logs and databases 66 | ############################ 67 | 68 | .tmp 69 | *.log 70 | *.sql 71 | *.sqlite 72 | *.sqlite3 73 | 74 | 75 | ############################ 76 | # Misc. 77 | ############################ 78 | 79 | *# 80 | ssl 81 | .idea 82 | nbproject 83 | public/uploads/* 84 | !public/uploads/.gitkeep 85 | 86 | ############################ 87 | # Node.js 88 | ############################ 89 | 90 | lib-cov 91 | lcov.info 92 | pids 93 | logs 94 | results 95 | node_modules 96 | .node_history 97 | 98 | 99 | ############################ 100 | # Tests 101 | ############################ 102 | 103 | testApp 104 | coverage 105 | 106 | ############################ 107 | # Strapi 108 | ############################ 109 | 110 | .env 111 | exports 112 | .cache 113 | build 114 | package-lock.json 115 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Strapi application using MongoDB & Cloudinary 2 | 3 | To deploy this Strapi instance you'll need: 4 | 5 | - [A Heroku account](https://signup.heroku.com/) for free 6 | - [A MongoDB Atlas account for database](https://account.mongodb.com/account/register) for free 7 | - [A Cloudinary account for saving images](https://cloudinary.com/users/register/free) for free 8 | 9 | Once you have created these accounts you can deploy your instance by clicking on this button 10 | 11 | [![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/devdizer/Strapi-mongodb-cloudinary) 12 | 13 | # Usage: 14 | 15 | Click for video demo: 16 | 17 | [![Click for demo video](https://i.ytimg.com/vi/SNQQaPPF_WI/hqdefault.jpg?sqp=-oaymwEZCNACELwBSFXyq4qpAwsIARUAAIhCGAFwAQ==&rs=AOn4CLCwrccvWncUY8bppHsaC35QJSqBxg)](https://www.youtube.com/watch?v=SNQQaPPF_WI) 18 | -------------------------------------------------------------------------------- /api/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devdizer/Strapi-mongodb-cloudinary/c868d05bc21cbae3c1bc89b429d1ebdf90720eef/api/.gitkeep -------------------------------------------------------------------------------- /api/article/config/routes.json: -------------------------------------------------------------------------------- 1 | { 2 | "routes": [ 3 | { 4 | "method": "GET", 5 | "path": "/articles", 6 | "handler": "article.find", 7 | "config": { 8 | "policies": [] 9 | } 10 | }, 11 | { 12 | "method": "GET", 13 | "path": "/articles/count", 14 | "handler": "article.count", 15 | "config": { 16 | "policies": [] 17 | } 18 | }, 19 | { 20 | "method": "GET", 21 | "path": "/articles/:id", 22 | "handler": "article.findOne", 23 | "config": { 24 | "policies": [] 25 | } 26 | }, 27 | { 28 | "method": "POST", 29 | "path": "/articles", 30 | "handler": "article.create", 31 | "config": { 32 | "policies": [] 33 | } 34 | }, 35 | { 36 | "method": "PUT", 37 | "path": "/articles/:id", 38 | "handler": "article.update", 39 | "config": { 40 | "policies": [] 41 | } 42 | }, 43 | { 44 | "method": "DELETE", 45 | "path": "/articles/:id", 46 | "handler": "article.delete", 47 | "config": { 48 | "policies": [] 49 | } 50 | } 51 | ] 52 | } 53 | -------------------------------------------------------------------------------- /api/article/controllers/article.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * Read the documentation (https://strapi.io/documentation/v3.x/concepts/controllers.html#core-controllers) 5 | * to customize this controller 6 | */ 7 | 8 | module.exports = {}; 9 | -------------------------------------------------------------------------------- /api/article/documentation/1.0.0/article.json: -------------------------------------------------------------------------------- 1 | { 2 | "paths": { 3 | "/articles": { 4 | "get": { 5 | "deprecated": false, 6 | "description": "", 7 | "responses": { 8 | "200": { 9 | "description": "response", 10 | "content": { 11 | "application/json": { 12 | "schema": { 13 | "type": "array", 14 | "items": { 15 | "$ref": "#/components/schemas/Article" 16 | } 17 | } 18 | } 19 | } 20 | }, 21 | "403": { 22 | "description": "Forbidden", 23 | "content": { 24 | "application/json": { 25 | "schema": { 26 | "$ref": "#/components/schemas/Error" 27 | } 28 | } 29 | } 30 | }, 31 | "404": { 32 | "description": "Not found", 33 | "content": { 34 | "application/json": { 35 | "schema": { 36 | "$ref": "#/components/schemas/Error" 37 | } 38 | } 39 | } 40 | }, 41 | "default": { 42 | "description": "unexpected error", 43 | "content": { 44 | "application/json": { 45 | "schema": { 46 | "$ref": "#/components/schemas/Error" 47 | } 48 | } 49 | } 50 | } 51 | }, 52 | "summary": "", 53 | "tags": [ 54 | "Article" 55 | ], 56 | "parameters": [ 57 | { 58 | "name": "_limit", 59 | "in": "query", 60 | "required": false, 61 | "description": "Maximum number of results possible", 62 | "schema": { 63 | "type": "integer" 64 | }, 65 | "deprecated": false 66 | }, 67 | { 68 | "name": "_sort", 69 | "in": "query", 70 | "required": false, 71 | "description": "Sort according to a specific field.", 72 | "schema": { 73 | "type": "string" 74 | }, 75 | "deprecated": false 76 | }, 77 | { 78 | "name": "_start", 79 | "in": "query", 80 | "required": false, 81 | "description": "Skip a specific number of entries (especially useful for pagination)", 82 | "schema": { 83 | "type": "integer" 84 | }, 85 | "deprecated": false 86 | }, 87 | { 88 | "name": "=", 89 | "in": "query", 90 | "required": false, 91 | "description": "Get entries that matches exactly your input", 92 | "schema": { 93 | "type": "string" 94 | }, 95 | "deprecated": false 96 | }, 97 | { 98 | "name": "_ne", 99 | "in": "query", 100 | "required": false, 101 | "description": "Get records that are not equals to something", 102 | "schema": { 103 | "type": "string" 104 | }, 105 | "deprecated": false 106 | }, 107 | { 108 | "name": "_lt", 109 | "in": "query", 110 | "required": false, 111 | "description": "Get record that are lower than a value", 112 | "schema": { 113 | "type": "string" 114 | }, 115 | "deprecated": false 116 | }, 117 | { 118 | "name": "_lte", 119 | "in": "query", 120 | "required": false, 121 | "description": "Get records that are lower than or equal to a value", 122 | "schema": { 123 | "type": "string" 124 | }, 125 | "deprecated": false 126 | }, 127 | { 128 | "name": "_gt", 129 | "in": "query", 130 | "required": false, 131 | "description": "Get records that are greater than a value", 132 | "schema": { 133 | "type": "string" 134 | }, 135 | "deprecated": false 136 | }, 137 | { 138 | "name": "_gte", 139 | "in": "query", 140 | "required": false, 141 | "description": "Get records that are greater than or equal a value", 142 | "schema": { 143 | "type": "string" 144 | }, 145 | "deprecated": false 146 | }, 147 | { 148 | "name": "_contains", 149 | "in": "query", 150 | "required": false, 151 | "description": "Get records that contains a value", 152 | "schema": { 153 | "type": "string" 154 | }, 155 | "deprecated": false 156 | }, 157 | { 158 | "name": "_containss", 159 | "in": "query", 160 | "required": false, 161 | "description": "Get records that contains (case sensitive) a value", 162 | "schema": { 163 | "type": "string" 164 | }, 165 | "deprecated": false 166 | }, 167 | { 168 | "name": "_in", 169 | "in": "query", 170 | "required": false, 171 | "description": "Get records that matches any value in the array of values", 172 | "schema": { 173 | "type": "array", 174 | "items": { 175 | "type": "string" 176 | } 177 | }, 178 | "deprecated": false 179 | }, 180 | { 181 | "name": "_nin", 182 | "in": "query", 183 | "required": false, 184 | "description": "Get records that doesn't match any value in the array of values", 185 | "schema": { 186 | "type": "array", 187 | "items": { 188 | "type": "string" 189 | } 190 | }, 191 | "deprecated": false 192 | } 193 | ] 194 | }, 195 | "post": { 196 | "deprecated": false, 197 | "description": "Create a new record", 198 | "responses": { 199 | "200": { 200 | "description": "response", 201 | "content": { 202 | "application/json": { 203 | "schema": { 204 | "$ref": "#/components/schemas/Article" 205 | } 206 | } 207 | } 208 | }, 209 | "403": { 210 | "description": "Forbidden", 211 | "content": { 212 | "application/json": { 213 | "schema": { 214 | "$ref": "#/components/schemas/Error" 215 | } 216 | } 217 | } 218 | }, 219 | "404": { 220 | "description": "Not found", 221 | "content": { 222 | "application/json": { 223 | "schema": { 224 | "$ref": "#/components/schemas/Error" 225 | } 226 | } 227 | } 228 | }, 229 | "default": { 230 | "description": "unexpected error", 231 | "content": { 232 | "application/json": { 233 | "schema": { 234 | "$ref": "#/components/schemas/Error" 235 | } 236 | } 237 | } 238 | } 239 | }, 240 | "summary": "", 241 | "tags": [ 242 | "Article" 243 | ], 244 | "requestBody": { 245 | "description": "", 246 | "required": true, 247 | "content": { 248 | "application/json": { 249 | "schema": { 250 | "$ref": "#/components/schemas/NewArticle" 251 | } 252 | } 253 | } 254 | } 255 | } 256 | }, 257 | "/articles/count": { 258 | "get": { 259 | "deprecated": false, 260 | "description": "", 261 | "responses": { 262 | "200": { 263 | "description": "response", 264 | "content": { 265 | "application/json": { 266 | "schema": { 267 | "properties": { 268 | "count": { 269 | "type": "integer" 270 | } 271 | } 272 | } 273 | } 274 | } 275 | }, 276 | "403": { 277 | "description": "Forbidden", 278 | "content": { 279 | "application/json": { 280 | "schema": { 281 | "$ref": "#/components/schemas/Error" 282 | } 283 | } 284 | } 285 | }, 286 | "404": { 287 | "description": "Not found", 288 | "content": { 289 | "application/json": { 290 | "schema": { 291 | "$ref": "#/components/schemas/Error" 292 | } 293 | } 294 | } 295 | }, 296 | "default": { 297 | "description": "unexpected error", 298 | "content": { 299 | "application/json": { 300 | "schema": { 301 | "$ref": "#/components/schemas/Error" 302 | } 303 | } 304 | } 305 | } 306 | }, 307 | "summary": "", 308 | "tags": [ 309 | "Article" 310 | ], 311 | "parameters": [] 312 | } 313 | }, 314 | "/articles/{id}": { 315 | "get": { 316 | "deprecated": false, 317 | "description": "", 318 | "responses": { 319 | "200": { 320 | "description": "response", 321 | "content": { 322 | "application/json": { 323 | "schema": { 324 | "$ref": "#/components/schemas/Article" 325 | } 326 | } 327 | } 328 | }, 329 | "403": { 330 | "description": "Forbidden", 331 | "content": { 332 | "application/json": { 333 | "schema": { 334 | "$ref": "#/components/schemas/Error" 335 | } 336 | } 337 | } 338 | }, 339 | "404": { 340 | "description": "Not found", 341 | "content": { 342 | "application/json": { 343 | "schema": { 344 | "$ref": "#/components/schemas/Error" 345 | } 346 | } 347 | } 348 | }, 349 | "default": { 350 | "description": "unexpected error", 351 | "content": { 352 | "application/json": { 353 | "schema": { 354 | "$ref": "#/components/schemas/Error" 355 | } 356 | } 357 | } 358 | } 359 | }, 360 | "summary": "", 361 | "tags": [ 362 | "Article" 363 | ], 364 | "parameters": [ 365 | { 366 | "name": "id", 367 | "in": "path", 368 | "description": "", 369 | "deprecated": false, 370 | "required": true, 371 | "schema": { 372 | "type": "string" 373 | } 374 | } 375 | ] 376 | }, 377 | "put": { 378 | "deprecated": false, 379 | "description": "Update a record", 380 | "responses": { 381 | "200": { 382 | "description": "response", 383 | "content": { 384 | "application/json": { 385 | "schema": { 386 | "$ref": "#/components/schemas/Article" 387 | } 388 | } 389 | } 390 | }, 391 | "403": { 392 | "description": "Forbidden", 393 | "content": { 394 | "application/json": { 395 | "schema": { 396 | "$ref": "#/components/schemas/Error" 397 | } 398 | } 399 | } 400 | }, 401 | "404": { 402 | "description": "Not found", 403 | "content": { 404 | "application/json": { 405 | "schema": { 406 | "$ref": "#/components/schemas/Error" 407 | } 408 | } 409 | } 410 | }, 411 | "default": { 412 | "description": "unexpected error", 413 | "content": { 414 | "application/json": { 415 | "schema": { 416 | "$ref": "#/components/schemas/Error" 417 | } 418 | } 419 | } 420 | } 421 | }, 422 | "summary": "", 423 | "tags": [ 424 | "Article" 425 | ], 426 | "requestBody": { 427 | "description": "", 428 | "required": true, 429 | "content": { 430 | "application/json": { 431 | "schema": { 432 | "$ref": "#/components/schemas/NewArticle" 433 | } 434 | } 435 | } 436 | }, 437 | "parameters": [ 438 | { 439 | "name": "id", 440 | "in": "path", 441 | "description": "", 442 | "deprecated": false, 443 | "required": true, 444 | "schema": { 445 | "type": "string" 446 | } 447 | } 448 | ] 449 | }, 450 | "delete": { 451 | "deprecated": false, 452 | "description": "Delete a record", 453 | "responses": { 454 | "200": { 455 | "description": "deletes a single record based on the ID supplied", 456 | "content": { 457 | "application/json": { 458 | "schema": { 459 | "type": "integer", 460 | "format": "int64" 461 | } 462 | } 463 | } 464 | }, 465 | "403": { 466 | "description": "Forbidden", 467 | "content": { 468 | "application/json": { 469 | "schema": { 470 | "$ref": "#/components/schemas/Error" 471 | } 472 | } 473 | } 474 | }, 475 | "404": { 476 | "description": "Not found", 477 | "content": { 478 | "application/json": { 479 | "schema": { 480 | "$ref": "#/components/schemas/Error" 481 | } 482 | } 483 | } 484 | }, 485 | "default": { 486 | "description": "unexpected error", 487 | "content": { 488 | "application/json": { 489 | "schema": { 490 | "$ref": "#/components/schemas/Error" 491 | } 492 | } 493 | } 494 | } 495 | }, 496 | "summary": "", 497 | "tags": [ 498 | "Article" 499 | ], 500 | "parameters": [ 501 | { 502 | "name": "id", 503 | "in": "path", 504 | "description": "", 505 | "deprecated": false, 506 | "required": true, 507 | "schema": { 508 | "type": "string" 509 | } 510 | } 511 | ] 512 | } 513 | } 514 | }, 515 | "components": { 516 | "schemas": { 517 | "Article": { 518 | "required": [ 519 | "id" 520 | ], 521 | "properties": { 522 | "id": { 523 | "type": "string" 524 | }, 525 | "title": { 526 | "type": "string" 527 | }, 528 | "description": { 529 | "type": "string" 530 | }, 531 | "content": { 532 | "type": "string" 533 | }, 534 | "source": { 535 | "type": "string" 536 | }, 537 | "image": { 538 | "required": [ 539 | "id", 540 | "name", 541 | "hash", 542 | "mime", 543 | "size", 544 | "url", 545 | "provider" 546 | ], 547 | "properties": { 548 | "id": { 549 | "type": "string" 550 | }, 551 | "name": { 552 | "type": "string" 553 | }, 554 | "alternativeText": { 555 | "type": "string" 556 | }, 557 | "caption": { 558 | "type": "string" 559 | }, 560 | "width": { 561 | "type": "integer" 562 | }, 563 | "height": { 564 | "type": "integer" 565 | }, 566 | "formats": { 567 | "type": "object" 568 | }, 569 | "hash": { 570 | "type": "string" 571 | }, 572 | "ext": { 573 | "type": "string" 574 | }, 575 | "mime": { 576 | "type": "string" 577 | }, 578 | "size": { 579 | "type": "number" 580 | }, 581 | "url": { 582 | "type": "string" 583 | }, 584 | "previewUrl": { 585 | "type": "string" 586 | }, 587 | "provider": { 588 | "type": "string" 589 | }, 590 | "provider_metadata": { 591 | "type": "object" 592 | }, 593 | "related": { 594 | "type": "string" 595 | } 596 | } 597 | }, 598 | "category": { 599 | "required": [ 600 | "id" 601 | ], 602 | "properties": { 603 | "id": { 604 | "type": "string" 605 | }, 606 | "name": { 607 | "type": "string" 608 | }, 609 | "image": { 610 | "type": "string" 611 | }, 612 | "articles": { 613 | "type": "array", 614 | "items": { 615 | "type": "string" 616 | } 617 | } 618 | } 619 | }, 620 | "users": { 621 | "type": "array", 622 | "items": { 623 | "required": [ 624 | "id", 625 | "username", 626 | "email" 627 | ], 628 | "properties": { 629 | "id": { 630 | "type": "string" 631 | }, 632 | "username": { 633 | "type": "string" 634 | }, 635 | "email": { 636 | "type": "string" 637 | }, 638 | "provider": { 639 | "type": "string" 640 | }, 641 | "password": { 642 | "type": "string" 643 | }, 644 | "resetPasswordToken": { 645 | "type": "string" 646 | }, 647 | "confirmed": { 648 | "type": "boolean" 649 | }, 650 | "blocked": { 651 | "type": "boolean" 652 | }, 653 | "role": { 654 | "type": "string" 655 | }, 656 | "image": { 657 | "type": "string" 658 | }, 659 | "articles": { 660 | "type": "array", 661 | "items": { 662 | "type": "string" 663 | } 664 | } 665 | } 666 | } 667 | } 668 | } 669 | }, 670 | "NewArticle": { 671 | "properties": { 672 | "title": { 673 | "type": "string" 674 | }, 675 | "description": { 676 | "type": "string" 677 | }, 678 | "content": { 679 | "type": "string" 680 | }, 681 | "source": { 682 | "type": "string" 683 | }, 684 | "category": { 685 | "type": "string" 686 | }, 687 | "users": { 688 | "type": "array", 689 | "items": { 690 | "type": "string" 691 | } 692 | } 693 | } 694 | } 695 | } 696 | }, 697 | "tags": [ 698 | { 699 | "name": "Article" 700 | } 701 | ] 702 | } -------------------------------------------------------------------------------- /api/article/models/article.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * Read the documentation (https://strapi.io/documentation/v3.x/concepts/models.html#lifecycle-hooks) 5 | * to customize this model 6 | */ 7 | 8 | module.exports = {}; 9 | -------------------------------------------------------------------------------- /api/article/models/article.settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "kind": "collectionType", 3 | "collectionName": "articles", 4 | "info": { 5 | "name": "article" 6 | }, 7 | "options": { 8 | "increments": true, 9 | "timestamps": true 10 | }, 11 | "attributes": { 12 | "title": { 13 | "type": "string" 14 | }, 15 | "description": { 16 | "type": "string" 17 | }, 18 | "content": { 19 | "type": "richtext" 20 | }, 21 | "source": { 22 | "type": "string" 23 | }, 24 | "image": { 25 | "model": "file", 26 | "via": "related", 27 | "allowedTypes": [ 28 | "images", 29 | "files", 30 | "videos" 31 | ], 32 | "plugin": "upload", 33 | "required": false 34 | }, 35 | "category": { 36 | "unique": true, 37 | "model": "category", 38 | "via": "articles" 39 | }, 40 | "users": { 41 | "via": "articles", 42 | "plugin": "users-permissions", 43 | "collection": "user" 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /api/article/services/article.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * Read the documentation (https://strapi.io/documentation/v3.x/concepts/services.html#core-services) 5 | * to customize this service 6 | */ 7 | 8 | module.exports = {}; 9 | -------------------------------------------------------------------------------- /api/category/config/routes.json: -------------------------------------------------------------------------------- 1 | { 2 | "routes": [ 3 | { 4 | "method": "GET", 5 | "path": "/categories", 6 | "handler": "category.find", 7 | "config": { 8 | "policies": [] 9 | } 10 | }, 11 | { 12 | "method": "GET", 13 | "path": "/categories/count", 14 | "handler": "category.count", 15 | "config": { 16 | "policies": [] 17 | } 18 | }, 19 | { 20 | "method": "GET", 21 | "path": "/categories/:id", 22 | "handler": "category.findOne", 23 | "config": { 24 | "policies": [] 25 | } 26 | }, 27 | { 28 | "method": "POST", 29 | "path": "/categories", 30 | "handler": "category.create", 31 | "config": { 32 | "policies": [] 33 | } 34 | }, 35 | { 36 | "method": "PUT", 37 | "path": "/categories/:id", 38 | "handler": "category.update", 39 | "config": { 40 | "policies": [] 41 | } 42 | }, 43 | { 44 | "method": "DELETE", 45 | "path": "/categories/:id", 46 | "handler": "category.delete", 47 | "config": { 48 | "policies": [] 49 | } 50 | } 51 | ] 52 | } 53 | -------------------------------------------------------------------------------- /api/category/controllers/category.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * Read the documentation (https://strapi.io/documentation/v3.x/concepts/controllers.html#core-controllers) 5 | * to customize this controller 6 | */ 7 | 8 | module.exports = {}; 9 | -------------------------------------------------------------------------------- /api/category/documentation/1.0.0/category.json: -------------------------------------------------------------------------------- 1 | { 2 | "paths": { 3 | "/categories": { 4 | "get": { 5 | "deprecated": false, 6 | "description": "", 7 | "responses": { 8 | "200": { 9 | "description": "response", 10 | "content": { 11 | "application/json": { 12 | "schema": { 13 | "type": "array", 14 | "items": { 15 | "$ref": "#/components/schemas/Category" 16 | } 17 | } 18 | } 19 | } 20 | }, 21 | "403": { 22 | "description": "Forbidden", 23 | "content": { 24 | "application/json": { 25 | "schema": { 26 | "$ref": "#/components/schemas/Error" 27 | } 28 | } 29 | } 30 | }, 31 | "404": { 32 | "description": "Not found", 33 | "content": { 34 | "application/json": { 35 | "schema": { 36 | "$ref": "#/components/schemas/Error" 37 | } 38 | } 39 | } 40 | }, 41 | "default": { 42 | "description": "unexpected error", 43 | "content": { 44 | "application/json": { 45 | "schema": { 46 | "$ref": "#/components/schemas/Error" 47 | } 48 | } 49 | } 50 | } 51 | }, 52 | "summary": "", 53 | "tags": [ 54 | "Category" 55 | ], 56 | "parameters": [ 57 | { 58 | "name": "_limit", 59 | "in": "query", 60 | "required": false, 61 | "description": "Maximum number of results possible", 62 | "schema": { 63 | "type": "integer" 64 | }, 65 | "deprecated": false 66 | }, 67 | { 68 | "name": "_sort", 69 | "in": "query", 70 | "required": false, 71 | "description": "Sort according to a specific field.", 72 | "schema": { 73 | "type": "string" 74 | }, 75 | "deprecated": false 76 | }, 77 | { 78 | "name": "_start", 79 | "in": "query", 80 | "required": false, 81 | "description": "Skip a specific number of entries (especially useful for pagination)", 82 | "schema": { 83 | "type": "integer" 84 | }, 85 | "deprecated": false 86 | }, 87 | { 88 | "name": "=", 89 | "in": "query", 90 | "required": false, 91 | "description": "Get entries that matches exactly your input", 92 | "schema": { 93 | "type": "string" 94 | }, 95 | "deprecated": false 96 | }, 97 | { 98 | "name": "_ne", 99 | "in": "query", 100 | "required": false, 101 | "description": "Get records that are not equals to something", 102 | "schema": { 103 | "type": "string" 104 | }, 105 | "deprecated": false 106 | }, 107 | { 108 | "name": "_lt", 109 | "in": "query", 110 | "required": false, 111 | "description": "Get record that are lower than a value", 112 | "schema": { 113 | "type": "string" 114 | }, 115 | "deprecated": false 116 | }, 117 | { 118 | "name": "_lte", 119 | "in": "query", 120 | "required": false, 121 | "description": "Get records that are lower than or equal to a value", 122 | "schema": { 123 | "type": "string" 124 | }, 125 | "deprecated": false 126 | }, 127 | { 128 | "name": "_gt", 129 | "in": "query", 130 | "required": false, 131 | "description": "Get records that are greater than a value", 132 | "schema": { 133 | "type": "string" 134 | }, 135 | "deprecated": false 136 | }, 137 | { 138 | "name": "_gte", 139 | "in": "query", 140 | "required": false, 141 | "description": "Get records that are greater than or equal a value", 142 | "schema": { 143 | "type": "string" 144 | }, 145 | "deprecated": false 146 | }, 147 | { 148 | "name": "_contains", 149 | "in": "query", 150 | "required": false, 151 | "description": "Get records that contains a value", 152 | "schema": { 153 | "type": "string" 154 | }, 155 | "deprecated": false 156 | }, 157 | { 158 | "name": "_containss", 159 | "in": "query", 160 | "required": false, 161 | "description": "Get records that contains (case sensitive) a value", 162 | "schema": { 163 | "type": "string" 164 | }, 165 | "deprecated": false 166 | }, 167 | { 168 | "name": "_in", 169 | "in": "query", 170 | "required": false, 171 | "description": "Get records that matches any value in the array of values", 172 | "schema": { 173 | "type": "array", 174 | "items": { 175 | "type": "string" 176 | } 177 | }, 178 | "deprecated": false 179 | }, 180 | { 181 | "name": "_nin", 182 | "in": "query", 183 | "required": false, 184 | "description": "Get records that doesn't match any value in the array of values", 185 | "schema": { 186 | "type": "array", 187 | "items": { 188 | "type": "string" 189 | } 190 | }, 191 | "deprecated": false 192 | } 193 | ] 194 | }, 195 | "post": { 196 | "deprecated": false, 197 | "description": "Create a new record", 198 | "responses": { 199 | "200": { 200 | "description": "response", 201 | "content": { 202 | "application/json": { 203 | "schema": { 204 | "$ref": "#/components/schemas/Category" 205 | } 206 | } 207 | } 208 | }, 209 | "403": { 210 | "description": "Forbidden", 211 | "content": { 212 | "application/json": { 213 | "schema": { 214 | "$ref": "#/components/schemas/Error" 215 | } 216 | } 217 | } 218 | }, 219 | "404": { 220 | "description": "Not found", 221 | "content": { 222 | "application/json": { 223 | "schema": { 224 | "$ref": "#/components/schemas/Error" 225 | } 226 | } 227 | } 228 | }, 229 | "default": { 230 | "description": "unexpected error", 231 | "content": { 232 | "application/json": { 233 | "schema": { 234 | "$ref": "#/components/schemas/Error" 235 | } 236 | } 237 | } 238 | } 239 | }, 240 | "summary": "", 241 | "tags": [ 242 | "Category" 243 | ], 244 | "requestBody": { 245 | "description": "", 246 | "required": true, 247 | "content": { 248 | "application/json": { 249 | "schema": { 250 | "$ref": "#/components/schemas/NewCategory" 251 | } 252 | } 253 | } 254 | } 255 | } 256 | }, 257 | "/categories/count": { 258 | "get": { 259 | "deprecated": false, 260 | "description": "", 261 | "responses": { 262 | "200": { 263 | "description": "response", 264 | "content": { 265 | "application/json": { 266 | "schema": { 267 | "properties": { 268 | "count": { 269 | "type": "integer" 270 | } 271 | } 272 | } 273 | } 274 | } 275 | }, 276 | "403": { 277 | "description": "Forbidden", 278 | "content": { 279 | "application/json": { 280 | "schema": { 281 | "$ref": "#/components/schemas/Error" 282 | } 283 | } 284 | } 285 | }, 286 | "404": { 287 | "description": "Not found", 288 | "content": { 289 | "application/json": { 290 | "schema": { 291 | "$ref": "#/components/schemas/Error" 292 | } 293 | } 294 | } 295 | }, 296 | "default": { 297 | "description": "unexpected error", 298 | "content": { 299 | "application/json": { 300 | "schema": { 301 | "$ref": "#/components/schemas/Error" 302 | } 303 | } 304 | } 305 | } 306 | }, 307 | "summary": "", 308 | "tags": [ 309 | "Category" 310 | ], 311 | "parameters": [] 312 | } 313 | }, 314 | "/categories/{id}": { 315 | "get": { 316 | "deprecated": false, 317 | "description": "", 318 | "responses": { 319 | "200": { 320 | "description": "response", 321 | "content": { 322 | "application/json": { 323 | "schema": { 324 | "$ref": "#/components/schemas/Category" 325 | } 326 | } 327 | } 328 | }, 329 | "403": { 330 | "description": "Forbidden", 331 | "content": { 332 | "application/json": { 333 | "schema": { 334 | "$ref": "#/components/schemas/Error" 335 | } 336 | } 337 | } 338 | }, 339 | "404": { 340 | "description": "Not found", 341 | "content": { 342 | "application/json": { 343 | "schema": { 344 | "$ref": "#/components/schemas/Error" 345 | } 346 | } 347 | } 348 | }, 349 | "default": { 350 | "description": "unexpected error", 351 | "content": { 352 | "application/json": { 353 | "schema": { 354 | "$ref": "#/components/schemas/Error" 355 | } 356 | } 357 | } 358 | } 359 | }, 360 | "summary": "", 361 | "tags": [ 362 | "Category" 363 | ], 364 | "parameters": [ 365 | { 366 | "name": "id", 367 | "in": "path", 368 | "description": "", 369 | "deprecated": false, 370 | "required": true, 371 | "schema": { 372 | "type": "string" 373 | } 374 | } 375 | ] 376 | }, 377 | "put": { 378 | "deprecated": false, 379 | "description": "Update a record", 380 | "responses": { 381 | "200": { 382 | "description": "response", 383 | "content": { 384 | "application/json": { 385 | "schema": { 386 | "$ref": "#/components/schemas/Category" 387 | } 388 | } 389 | } 390 | }, 391 | "403": { 392 | "description": "Forbidden", 393 | "content": { 394 | "application/json": { 395 | "schema": { 396 | "$ref": "#/components/schemas/Error" 397 | } 398 | } 399 | } 400 | }, 401 | "404": { 402 | "description": "Not found", 403 | "content": { 404 | "application/json": { 405 | "schema": { 406 | "$ref": "#/components/schemas/Error" 407 | } 408 | } 409 | } 410 | }, 411 | "default": { 412 | "description": "unexpected error", 413 | "content": { 414 | "application/json": { 415 | "schema": { 416 | "$ref": "#/components/schemas/Error" 417 | } 418 | } 419 | } 420 | } 421 | }, 422 | "summary": "", 423 | "tags": [ 424 | "Category" 425 | ], 426 | "requestBody": { 427 | "description": "", 428 | "required": true, 429 | "content": { 430 | "application/json": { 431 | "schema": { 432 | "$ref": "#/components/schemas/NewCategory" 433 | } 434 | } 435 | } 436 | }, 437 | "parameters": [ 438 | { 439 | "name": "id", 440 | "in": "path", 441 | "description": "", 442 | "deprecated": false, 443 | "required": true, 444 | "schema": { 445 | "type": "string" 446 | } 447 | } 448 | ] 449 | }, 450 | "delete": { 451 | "deprecated": false, 452 | "description": "Delete a record", 453 | "responses": { 454 | "200": { 455 | "description": "deletes a single record based on the ID supplied", 456 | "content": { 457 | "application/json": { 458 | "schema": { 459 | "type": "integer", 460 | "format": "int64" 461 | } 462 | } 463 | } 464 | }, 465 | "403": { 466 | "description": "Forbidden", 467 | "content": { 468 | "application/json": { 469 | "schema": { 470 | "$ref": "#/components/schemas/Error" 471 | } 472 | } 473 | } 474 | }, 475 | "404": { 476 | "description": "Not found", 477 | "content": { 478 | "application/json": { 479 | "schema": { 480 | "$ref": "#/components/schemas/Error" 481 | } 482 | } 483 | } 484 | }, 485 | "default": { 486 | "description": "unexpected error", 487 | "content": { 488 | "application/json": { 489 | "schema": { 490 | "$ref": "#/components/schemas/Error" 491 | } 492 | } 493 | } 494 | } 495 | }, 496 | "summary": "", 497 | "tags": [ 498 | "Category" 499 | ], 500 | "parameters": [ 501 | { 502 | "name": "id", 503 | "in": "path", 504 | "description": "", 505 | "deprecated": false, 506 | "required": true, 507 | "schema": { 508 | "type": "string" 509 | } 510 | } 511 | ] 512 | } 513 | } 514 | }, 515 | "components": { 516 | "schemas": { 517 | "Category": { 518 | "required": [ 519 | "id" 520 | ], 521 | "properties": { 522 | "id": { 523 | "type": "string" 524 | }, 525 | "name": { 526 | "type": "string" 527 | }, 528 | "image": { 529 | "required": [ 530 | "id", 531 | "name", 532 | "hash", 533 | "mime", 534 | "size", 535 | "url", 536 | "provider" 537 | ], 538 | "properties": { 539 | "id": { 540 | "type": "string" 541 | }, 542 | "name": { 543 | "type": "string" 544 | }, 545 | "alternativeText": { 546 | "type": "string" 547 | }, 548 | "caption": { 549 | "type": "string" 550 | }, 551 | "width": { 552 | "type": "integer" 553 | }, 554 | "height": { 555 | "type": "integer" 556 | }, 557 | "formats": { 558 | "type": "object" 559 | }, 560 | "hash": { 561 | "type": "string" 562 | }, 563 | "ext": { 564 | "type": "string" 565 | }, 566 | "mime": { 567 | "type": "string" 568 | }, 569 | "size": { 570 | "type": "number" 571 | }, 572 | "url": { 573 | "type": "string" 574 | }, 575 | "previewUrl": { 576 | "type": "string" 577 | }, 578 | "provider": { 579 | "type": "string" 580 | }, 581 | "provider_metadata": { 582 | "type": "object" 583 | }, 584 | "related": { 585 | "type": "string" 586 | } 587 | } 588 | }, 589 | "articles": { 590 | "type": "array", 591 | "items": { 592 | "required": [ 593 | "id" 594 | ], 595 | "properties": { 596 | "id": { 597 | "type": "string" 598 | }, 599 | "title": { 600 | "type": "string" 601 | }, 602 | "description": { 603 | "type": "string" 604 | }, 605 | "content": { 606 | "type": "string" 607 | }, 608 | "source": { 609 | "type": "string" 610 | }, 611 | "image": { 612 | "type": "string" 613 | }, 614 | "category": { 615 | "type": "string" 616 | }, 617 | "users": { 618 | "type": "array", 619 | "items": { 620 | "type": "string" 621 | } 622 | } 623 | } 624 | } 625 | } 626 | } 627 | }, 628 | "NewCategory": { 629 | "properties": { 630 | "name": { 631 | "type": "string" 632 | }, 633 | "articles": { 634 | "type": "array", 635 | "items": { 636 | "type": "string" 637 | } 638 | } 639 | } 640 | } 641 | } 642 | }, 643 | "tags": [ 644 | { 645 | "name": "Category" 646 | } 647 | ] 648 | } -------------------------------------------------------------------------------- /api/category/models/category.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * Read the documentation (https://strapi.io/documentation/v3.x/concepts/models.html#lifecycle-hooks) 5 | * to customize this model 6 | */ 7 | 8 | module.exports = {}; 9 | -------------------------------------------------------------------------------- /api/category/models/category.settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "kind": "collectionType", 3 | "collectionName": "categories", 4 | "info": { 5 | "name": "category" 6 | }, 7 | "options": { 8 | "increments": true, 9 | "timestamps": true 10 | }, 11 | "attributes": { 12 | "name": { 13 | "type": "string", 14 | "unique": true 15 | }, 16 | "image": { 17 | "model": "file", 18 | "via": "related", 19 | "allowedTypes": [ 20 | "images", 21 | "files", 22 | "videos" 23 | ], 24 | "plugin": "upload", 25 | "required": false 26 | }, 27 | "articles": { 28 | "via": "category", 29 | "collection": "article" 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /api/category/services/category.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * Read the documentation (https://strapi.io/documentation/v3.x/concepts/services.html#core-services) 5 | * to customize this service 6 | */ 7 | 8 | module.exports = {}; 9 | -------------------------------------------------------------------------------- /app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Strapi", 3 | "description": "Strapi Heroku deployment with mongoddb & cloudinary upload plugin", 4 | "keywords": ["strapi", "heroku", "mongodb", "cloudinary"], 5 | "repository": "https://github.com/devdizer/Strapi-mongodb-cloudinary", 6 | "logo": "https://avatars2.githubusercontent.com/u/67114662?s=460&u=57a297f7c5f2da0c4ffa60970ddd03fa9847fda6&v=4", 7 | "env": { 8 | "DATABASE_URI": { 9 | "description": "Add your connection string to MongodDB Atlas", 10 | "required": true 11 | }, 12 | "CLOUDINARY_NAME": { 13 | "description": "The 'Cloud name' of your Cloudinary account", 14 | "required": true 15 | }, 16 | "CLOUDINARY_KEY": { 17 | "description": "The 'API Key' of your Cloudinary account", 18 | "required": true 19 | }, 20 | "CLOUDINARY_SECRET": { 21 | "description": "The 'API Secret' of your Cloudinary account", 22 | "required": true 23 | } 24 | } 25 | 26 | } -------------------------------------------------------------------------------- /config/env/development/database.js: -------------------------------------------------------------------------------- 1 | module.exports = ({ env }) => ({ 2 | defaultConnection: 'default', 3 | connections: { 4 | default: { 5 | connector: 'mongoose', 6 | settings: { 7 | uri: env('DATABASE_URI'), 8 | }, 9 | options: { 10 | authenticationDatabase: env('AUTHENTICATION_DATABASE', 'admin'), 11 | ssl: env.bool('DATABASE_SSL', true), 12 | }, 13 | }, 14 | }, 15 | }); 16 | -------------------------------------------------------------------------------- /config/env/development/plugins.js: -------------------------------------------------------------------------------- 1 | module.exports = ({ env }) => ({ 2 | 3 | upload: { 4 | provider: "cloudinary", 5 | providerOptions: { 6 | cloud_name: env('CLOUDINARY_NAME'), 7 | api_key: env('CLOUDINARY_KEY'), 8 | api_secret: env('CLOUDINARY_SECRET') 9 | } 10 | }, 11 | }); -------------------------------------------------------------------------------- /config/env/production/database.js: -------------------------------------------------------------------------------- 1 | module.exports = ({ env }) => ({ 2 | defaultConnection: 'default', 3 | connections: { 4 | default: { 5 | connector: 'mongoose', 6 | settings: { 7 | uri: env('DATABASE_URI'), 8 | }, 9 | options: { 10 | ssl: true, 11 | }, 12 | }, 13 | }, 14 | }); -------------------------------------------------------------------------------- /config/env/production/plugins.js: -------------------------------------------------------------------------------- 1 | module.exports = ({ env }) => ({ 2 | 3 | upload: { 4 | provider: "cloudinary", 5 | providerOptions: { 6 | cloud_name: env('CLOUDINARY_NAME'), 7 | api_key: env('CLOUDINARY_KEY'), 8 | api_secret: env('CLOUDINARY_SECRET') 9 | } 10 | }, 11 | }); -------------------------------------------------------------------------------- /config/functions/bootstrap.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * An asynchronous bootstrap function that runs before 5 | * your application gets started. 6 | * 7 | * This gives you an opportunity to set up your data model, 8 | * run jobs, or perform some special logic. 9 | * 10 | * See more details here: https://strapi.io/documentation/v3.x/concepts/configurations.html#bootstrap 11 | */ 12 | 13 | module.exports = () => {}; 14 | -------------------------------------------------------------------------------- /config/functions/cron.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * Cron config that gives you an opportunity 5 | * to run scheduled jobs. 6 | * 7 | * The cron format consists of: 8 | * [SECOND (optional)] [MINUTE] [HOUR] [DAY OF MONTH] [MONTH OF YEAR] [DAY OF WEEK] 9 | * 10 | * See more details here: https://strapi.io/documentation/v3.x/concepts/configurations.html#cron-tasks 11 | */ 12 | 13 | module.exports = { 14 | /** 15 | * Simple example. 16 | * Every monday at 1am. 17 | */ 18 | // '0 1 * * 1': () => { 19 | // 20 | // } 21 | }; 22 | -------------------------------------------------------------------------------- /config/functions/responses/404.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = async (/* ctx */) => { 4 | // return ctx.notFound('My custom message 404'); 5 | }; 6 | -------------------------------------------------------------------------------- /config/server.js: -------------------------------------------------------------------------------- 1 | module.exports = ({ env }) => ({ 2 | host: env('HOST', '0.0.0.0'), 3 | port: env.int('PORT', 1337), 4 | }); 5 | -------------------------------------------------------------------------------- /extensions/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devdizer/Strapi-mongodb-cloudinary/c868d05bc21cbae3c1bc89b429d1ebdf90720eef/extensions/.gitkeep -------------------------------------------------------------------------------- /extensions/email/documentation/1.0.0/email-Email.json: -------------------------------------------------------------------------------- 1 | { 2 | "paths": { 3 | "/email/": { 4 | "post": { 5 | "deprecated": false, 6 | "description": "Send an email", 7 | "responses": { 8 | "200": { 9 | "description": "response", 10 | "content": { 11 | "application/json": { 12 | "schema": { 13 | "properties": { 14 | "foo": { 15 | "type": "string" 16 | } 17 | } 18 | } 19 | } 20 | } 21 | }, 22 | "403": { 23 | "description": "Forbidden", 24 | "content": { 25 | "application/json": { 26 | "schema": { 27 | "$ref": "#/components/schemas/Error" 28 | } 29 | } 30 | } 31 | }, 32 | "404": { 33 | "description": "Not found", 34 | "content": { 35 | "application/json": { 36 | "schema": { 37 | "$ref": "#/components/schemas/Error" 38 | } 39 | } 40 | } 41 | }, 42 | "default": { 43 | "description": "unexpected error", 44 | "content": { 45 | "application/json": { 46 | "schema": { 47 | "$ref": "#/components/schemas/Error" 48 | } 49 | } 50 | } 51 | } 52 | }, 53 | "summary": "", 54 | "tags": [ 55 | "Email - Email" 56 | ], 57 | "requestBody": { 58 | "description": "", 59 | "required": true, 60 | "content": { 61 | "application/json": { 62 | "schema": { 63 | "properties": { 64 | "foo": { 65 | "type": "string" 66 | } 67 | } 68 | } 69 | } 70 | } 71 | } 72 | } 73 | } 74 | }, 75 | "tags": [ 76 | { 77 | "name": "Email - Email" 78 | } 79 | ] 80 | } -------------------------------------------------------------------------------- /extensions/upload/documentation/1.0.0/upload-File.json: -------------------------------------------------------------------------------- 1 | { 2 | "paths": { 3 | "/upload/": { 4 | "post": { 5 | "deprecated": false, 6 | "description": "Upload a file", 7 | "responses": { 8 | "200": { 9 | "description": "response", 10 | "content": { 11 | "application/json": { 12 | "schema": { 13 | "properties": { 14 | "foo": { 15 | "type": "string" 16 | } 17 | } 18 | } 19 | } 20 | } 21 | }, 22 | "403": { 23 | "description": "Forbidden", 24 | "content": { 25 | "application/json": { 26 | "schema": { 27 | "$ref": "#/components/schemas/Error" 28 | } 29 | } 30 | } 31 | }, 32 | "404": { 33 | "description": "Not found", 34 | "content": { 35 | "application/json": { 36 | "schema": { 37 | "$ref": "#/components/schemas/Error" 38 | } 39 | } 40 | } 41 | }, 42 | "default": { 43 | "description": "unexpected error", 44 | "content": { 45 | "application/json": { 46 | "schema": { 47 | "$ref": "#/components/schemas/Error" 48 | } 49 | } 50 | } 51 | } 52 | }, 53 | "summary": "", 54 | "tags": [ 55 | "Upload - File" 56 | ], 57 | "requestBody": { 58 | "description": "", 59 | "required": true, 60 | "content": { 61 | "application/json": { 62 | "schema": { 63 | "properties": { 64 | "foo": { 65 | "type": "string" 66 | } 67 | } 68 | } 69 | } 70 | } 71 | } 72 | } 73 | }, 74 | "/upload/files/count": { 75 | "get": { 76 | "deprecated": false, 77 | "description": "Retrieve the total number of uploaded files", 78 | "responses": { 79 | "200": { 80 | "description": "response", 81 | "content": { 82 | "application/json": { 83 | "schema": { 84 | "properties": { 85 | "foo": { 86 | "type": "string" 87 | } 88 | } 89 | } 90 | } 91 | } 92 | }, 93 | "403": { 94 | "description": "Forbidden", 95 | "content": { 96 | "application/json": { 97 | "schema": { 98 | "$ref": "#/components/schemas/Error" 99 | } 100 | } 101 | } 102 | }, 103 | "404": { 104 | "description": "Not found", 105 | "content": { 106 | "application/json": { 107 | "schema": { 108 | "$ref": "#/components/schemas/Error" 109 | } 110 | } 111 | } 112 | }, 113 | "default": { 114 | "description": "unexpected error", 115 | "content": { 116 | "application/json": { 117 | "schema": { 118 | "$ref": "#/components/schemas/Error" 119 | } 120 | } 121 | } 122 | } 123 | }, 124 | "summary": "", 125 | "tags": [ 126 | "Upload - File" 127 | ], 128 | "parameters": [] 129 | } 130 | }, 131 | "/upload/files": { 132 | "get": { 133 | "deprecated": false, 134 | "description": "Retrieve all file documents", 135 | "responses": { 136 | "200": { 137 | "description": "response", 138 | "content": { 139 | "application/json": { 140 | "schema": { 141 | "properties": { 142 | "foo": { 143 | "type": "string" 144 | } 145 | } 146 | } 147 | } 148 | } 149 | }, 150 | "403": { 151 | "description": "Forbidden", 152 | "content": { 153 | "application/json": { 154 | "schema": { 155 | "$ref": "#/components/schemas/Error" 156 | } 157 | } 158 | } 159 | }, 160 | "404": { 161 | "description": "Not found", 162 | "content": { 163 | "application/json": { 164 | "schema": { 165 | "$ref": "#/components/schemas/Error" 166 | } 167 | } 168 | } 169 | }, 170 | "default": { 171 | "description": "unexpected error", 172 | "content": { 173 | "application/json": { 174 | "schema": { 175 | "$ref": "#/components/schemas/Error" 176 | } 177 | } 178 | } 179 | } 180 | }, 181 | "summary": "", 182 | "tags": [ 183 | "Upload - File" 184 | ], 185 | "parameters": [] 186 | } 187 | }, 188 | "/upload/files/{id}": { 189 | "get": { 190 | "deprecated": false, 191 | "description": "Retrieve a single file depending on its id", 192 | "responses": { 193 | "200": { 194 | "description": "response", 195 | "content": { 196 | "application/json": { 197 | "schema": { 198 | "properties": { 199 | "foo": { 200 | "type": "string" 201 | } 202 | } 203 | } 204 | } 205 | } 206 | }, 207 | "403": { 208 | "description": "Forbidden", 209 | "content": { 210 | "application/json": { 211 | "schema": { 212 | "$ref": "#/components/schemas/Error" 213 | } 214 | } 215 | } 216 | }, 217 | "404": { 218 | "description": "Not found", 219 | "content": { 220 | "application/json": { 221 | "schema": { 222 | "$ref": "#/components/schemas/Error" 223 | } 224 | } 225 | } 226 | }, 227 | "default": { 228 | "description": "unexpected error", 229 | "content": { 230 | "application/json": { 231 | "schema": { 232 | "$ref": "#/components/schemas/Error" 233 | } 234 | } 235 | } 236 | } 237 | }, 238 | "summary": "", 239 | "tags": [ 240 | "Upload - File" 241 | ], 242 | "parameters": [ 243 | { 244 | "name": "id", 245 | "in": "path", 246 | "description": "", 247 | "deprecated": false, 248 | "required": true, 249 | "schema": { 250 | "type": "string" 251 | } 252 | } 253 | ] 254 | }, 255 | "delete": { 256 | "deprecated": false, 257 | "description": "Delete an uploaded file", 258 | "responses": { 259 | "200": { 260 | "description": "response", 261 | "content": { 262 | "application/json": { 263 | "schema": { 264 | "properties": { 265 | "foo": { 266 | "type": "string" 267 | } 268 | } 269 | } 270 | } 271 | } 272 | }, 273 | "403": { 274 | "description": "Forbidden", 275 | "content": { 276 | "application/json": { 277 | "schema": { 278 | "$ref": "#/components/schemas/Error" 279 | } 280 | } 281 | } 282 | }, 283 | "404": { 284 | "description": "Not found", 285 | "content": { 286 | "application/json": { 287 | "schema": { 288 | "$ref": "#/components/schemas/Error" 289 | } 290 | } 291 | } 292 | }, 293 | "default": { 294 | "description": "unexpected error", 295 | "content": { 296 | "application/json": { 297 | "schema": { 298 | "$ref": "#/components/schemas/Error" 299 | } 300 | } 301 | } 302 | } 303 | }, 304 | "summary": "", 305 | "tags": [ 306 | "Upload - File" 307 | ], 308 | "parameters": [ 309 | { 310 | "name": "id", 311 | "in": "path", 312 | "description": "", 313 | "deprecated": false, 314 | "required": true, 315 | "schema": { 316 | "type": "string" 317 | } 318 | } 319 | ] 320 | } 321 | }, 322 | "/upload/search/{id}": { 323 | "get": { 324 | "deprecated": false, 325 | "description": "Search for an uploaded file", 326 | "responses": { 327 | "200": { 328 | "description": "response", 329 | "content": { 330 | "application/json": { 331 | "schema": { 332 | "properties": { 333 | "foo": { 334 | "type": "string" 335 | } 336 | } 337 | } 338 | } 339 | } 340 | }, 341 | "403": { 342 | "description": "Forbidden", 343 | "content": { 344 | "application/json": { 345 | "schema": { 346 | "$ref": "#/components/schemas/Error" 347 | } 348 | } 349 | } 350 | }, 351 | "404": { 352 | "description": "Not found", 353 | "content": { 354 | "application/json": { 355 | "schema": { 356 | "$ref": "#/components/schemas/Error" 357 | } 358 | } 359 | } 360 | }, 361 | "default": { 362 | "description": "unexpected error", 363 | "content": { 364 | "application/json": { 365 | "schema": { 366 | "$ref": "#/components/schemas/Error" 367 | } 368 | } 369 | } 370 | } 371 | }, 372 | "summary": "", 373 | "tags": [ 374 | "Upload - File" 375 | ], 376 | "parameters": [ 377 | { 378 | "name": "id", 379 | "in": "path", 380 | "description": "", 381 | "deprecated": false, 382 | "required": true, 383 | "schema": { 384 | "type": "string" 385 | } 386 | } 387 | ] 388 | } 389 | } 390 | }, 391 | "tags": [ 392 | { 393 | "name": "Upload - File" 394 | } 395 | ] 396 | } -------------------------------------------------------------------------------- /extensions/users-permissions/config/jwt.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | jwtSecret: process.env.JWT_SECRET || '6565df82-2a5f-4015-803c-2398f87b4291' 3 | }; -------------------------------------------------------------------------------- /extensions/users-permissions/documentation/1.0.0/users-permissions-Role.json: -------------------------------------------------------------------------------- 1 | { 2 | "paths": { 3 | "/users-permissions/init": { 4 | "get": { 5 | "deprecated": false, 6 | "description": "Check if the first admin user has already been registered", 7 | "responses": { 8 | "200": { 9 | "description": "response", 10 | "content": { 11 | "application/json": { 12 | "schema": { 13 | "properties": { 14 | "foo": { 15 | "type": "string" 16 | } 17 | } 18 | } 19 | } 20 | } 21 | }, 22 | "403": { 23 | "description": "Forbidden", 24 | "content": { 25 | "application/json": { 26 | "schema": { 27 | "$ref": "#/components/schemas/Error" 28 | } 29 | } 30 | } 31 | }, 32 | "404": { 33 | "description": "Not found", 34 | "content": { 35 | "application/json": { 36 | "schema": { 37 | "$ref": "#/components/schemas/Error" 38 | } 39 | } 40 | } 41 | }, 42 | "default": { 43 | "description": "unexpected error", 44 | "content": { 45 | "application/json": { 46 | "schema": { 47 | "$ref": "#/components/schemas/Error" 48 | } 49 | } 50 | } 51 | } 52 | }, 53 | "summary": "", 54 | "tags": [ 55 | "UsersPermissions - Role" 56 | ], 57 | "parameters": [] 58 | } 59 | }, 60 | "/users-permissions/roles/{id}": { 61 | "get": { 62 | "deprecated": false, 63 | "description": "Retrieve a role depending on its id", 64 | "responses": { 65 | "200": { 66 | "description": "response", 67 | "content": { 68 | "application/json": { 69 | "schema": { 70 | "$ref": "#/components/schemas/UsersPermissionsRole" 71 | } 72 | } 73 | } 74 | }, 75 | "403": { 76 | "description": "Forbidden", 77 | "content": { 78 | "application/json": { 79 | "schema": { 80 | "$ref": "#/components/schemas/Error" 81 | } 82 | } 83 | } 84 | }, 85 | "404": { 86 | "description": "Not found", 87 | "content": { 88 | "application/json": { 89 | "schema": { 90 | "$ref": "#/components/schemas/Error" 91 | } 92 | } 93 | } 94 | }, 95 | "default": { 96 | "description": "unexpected error", 97 | "content": { 98 | "application/json": { 99 | "schema": { 100 | "$ref": "#/components/schemas/Error" 101 | } 102 | } 103 | } 104 | } 105 | }, 106 | "summary": "", 107 | "tags": [ 108 | "UsersPermissions - Role" 109 | ], 110 | "parameters": [ 111 | { 112 | "name": "id", 113 | "in": "path", 114 | "description": "", 115 | "deprecated": false, 116 | "required": true, 117 | "schema": { 118 | "type": "string" 119 | } 120 | } 121 | ] 122 | } 123 | }, 124 | "/users-permissions/roles": { 125 | "get": { 126 | "deprecated": false, 127 | "description": "Retrieve all role documents", 128 | "responses": { 129 | "200": { 130 | "description": "response", 131 | "content": { 132 | "application/json": { 133 | "schema": { 134 | "type": "array", 135 | "items": { 136 | "$ref": "#/components/schemas/UsersPermissionsRole" 137 | } 138 | } 139 | } 140 | } 141 | }, 142 | "403": { 143 | "description": "Forbidden", 144 | "content": { 145 | "application/json": { 146 | "schema": { 147 | "$ref": "#/components/schemas/Error" 148 | } 149 | } 150 | } 151 | }, 152 | "404": { 153 | "description": "Not found", 154 | "content": { 155 | "application/json": { 156 | "schema": { 157 | "$ref": "#/components/schemas/Error" 158 | } 159 | } 160 | } 161 | }, 162 | "default": { 163 | "description": "unexpected error", 164 | "content": { 165 | "application/json": { 166 | "schema": { 167 | "$ref": "#/components/schemas/Error" 168 | } 169 | } 170 | } 171 | } 172 | }, 173 | "summary": "", 174 | "tags": [ 175 | "UsersPermissions - Role" 176 | ], 177 | "parameters": [ 178 | { 179 | "name": "_limit", 180 | "in": "query", 181 | "required": false, 182 | "description": "Maximum number of results possible", 183 | "schema": { 184 | "type": "integer" 185 | }, 186 | "deprecated": false 187 | }, 188 | { 189 | "name": "_sort", 190 | "in": "query", 191 | "required": false, 192 | "description": "Sort according to a specific field.", 193 | "schema": { 194 | "type": "string" 195 | }, 196 | "deprecated": false 197 | }, 198 | { 199 | "name": "_start", 200 | "in": "query", 201 | "required": false, 202 | "description": "Skip a specific number of entries (especially useful for pagination)", 203 | "schema": { 204 | "type": "integer" 205 | }, 206 | "deprecated": false 207 | }, 208 | { 209 | "name": "=", 210 | "in": "query", 211 | "required": false, 212 | "description": "Get entries that matches exactly your input", 213 | "schema": { 214 | "type": "string" 215 | }, 216 | "deprecated": false 217 | }, 218 | { 219 | "name": "_ne", 220 | "in": "query", 221 | "required": false, 222 | "description": "Get records that are not equals to something", 223 | "schema": { 224 | "type": "string" 225 | }, 226 | "deprecated": false 227 | }, 228 | { 229 | "name": "_lt", 230 | "in": "query", 231 | "required": false, 232 | "description": "Get record that are lower than a value", 233 | "schema": { 234 | "type": "string" 235 | }, 236 | "deprecated": false 237 | }, 238 | { 239 | "name": "_lte", 240 | "in": "query", 241 | "required": false, 242 | "description": "Get records that are lower than or equal to a value", 243 | "schema": { 244 | "type": "string" 245 | }, 246 | "deprecated": false 247 | }, 248 | { 249 | "name": "_gt", 250 | "in": "query", 251 | "required": false, 252 | "description": "Get records that are greater than a value", 253 | "schema": { 254 | "type": "string" 255 | }, 256 | "deprecated": false 257 | }, 258 | { 259 | "name": "_gte", 260 | "in": "query", 261 | "required": false, 262 | "description": "Get records that are greater than or equal a value", 263 | "schema": { 264 | "type": "string" 265 | }, 266 | "deprecated": false 267 | }, 268 | { 269 | "name": "_contains", 270 | "in": "query", 271 | "required": false, 272 | "description": "Get records that contains a value", 273 | "schema": { 274 | "type": "string" 275 | }, 276 | "deprecated": false 277 | }, 278 | { 279 | "name": "_containss", 280 | "in": "query", 281 | "required": false, 282 | "description": "Get records that contains (case sensitive) a value", 283 | "schema": { 284 | "type": "string" 285 | }, 286 | "deprecated": false 287 | }, 288 | { 289 | "name": "_in", 290 | "in": "query", 291 | "required": false, 292 | "description": "Get records that matches any value in the array of values", 293 | "schema": { 294 | "type": "array", 295 | "items": { 296 | "type": "string" 297 | } 298 | }, 299 | "deprecated": false 300 | }, 301 | { 302 | "name": "_nin", 303 | "in": "query", 304 | "required": false, 305 | "description": "Get records that doesn't match any value in the array of values", 306 | "schema": { 307 | "type": "array", 308 | "items": { 309 | "type": "string" 310 | } 311 | }, 312 | "deprecated": false 313 | } 314 | ] 315 | }, 316 | "post": { 317 | "deprecated": false, 318 | "description": "Create a new role", 319 | "responses": { 320 | "200": { 321 | "description": "response", 322 | "content": { 323 | "application/json": { 324 | "schema": { 325 | "$ref": "#/components/schemas/UsersPermissionsRole" 326 | } 327 | } 328 | } 329 | }, 330 | "403": { 331 | "description": "Forbidden", 332 | "content": { 333 | "application/json": { 334 | "schema": { 335 | "$ref": "#/components/schemas/Error" 336 | } 337 | } 338 | } 339 | }, 340 | "404": { 341 | "description": "Not found", 342 | "content": { 343 | "application/json": { 344 | "schema": { 345 | "$ref": "#/components/schemas/Error" 346 | } 347 | } 348 | } 349 | }, 350 | "default": { 351 | "description": "unexpected error", 352 | "content": { 353 | "application/json": { 354 | "schema": { 355 | "$ref": "#/components/schemas/Error" 356 | } 357 | } 358 | } 359 | } 360 | }, 361 | "summary": "", 362 | "tags": [ 363 | "UsersPermissions - Role" 364 | ], 365 | "requestBody": { 366 | "description": "", 367 | "required": true, 368 | "content": { 369 | "application/json": { 370 | "schema": { 371 | "$ref": "#/components/schemas/NewUsersPermissionsRole" 372 | } 373 | } 374 | } 375 | } 376 | } 377 | }, 378 | "/users-permissions/roles/{role}": { 379 | "put": { 380 | "deprecated": false, 381 | "description": "Update a role", 382 | "responses": { 383 | "200": { 384 | "description": "response", 385 | "content": { 386 | "application/json": { 387 | "schema": { 388 | "$ref": "#/components/schemas/UsersPermissionsRole" 389 | } 390 | } 391 | } 392 | }, 393 | "403": { 394 | "description": "Forbidden", 395 | "content": { 396 | "application/json": { 397 | "schema": { 398 | "$ref": "#/components/schemas/Error" 399 | } 400 | } 401 | } 402 | }, 403 | "404": { 404 | "description": "Not found", 405 | "content": { 406 | "application/json": { 407 | "schema": { 408 | "$ref": "#/components/schemas/Error" 409 | } 410 | } 411 | } 412 | }, 413 | "default": { 414 | "description": "unexpected error", 415 | "content": { 416 | "application/json": { 417 | "schema": { 418 | "$ref": "#/components/schemas/Error" 419 | } 420 | } 421 | } 422 | } 423 | }, 424 | "summary": "", 425 | "tags": [ 426 | "UsersPermissions - Role" 427 | ], 428 | "parameters": [ 429 | { 430 | "name": "role", 431 | "in": "path", 432 | "description": "", 433 | "deprecated": false, 434 | "required": true, 435 | "schema": { 436 | "type": "string" 437 | } 438 | } 439 | ], 440 | "requestBody": { 441 | "description": "", 442 | "required": true, 443 | "content": { 444 | "application/json": { 445 | "schema": { 446 | "$ref": "#/components/schemas/NewUsersPermissionsRole" 447 | } 448 | } 449 | } 450 | } 451 | }, 452 | "delete": { 453 | "deprecated": false, 454 | "description": "Delete a role", 455 | "responses": { 456 | "200": { 457 | "description": "response", 458 | "content": { 459 | "application/json": { 460 | "schema": { 461 | "properties": { 462 | "foo": { 463 | "type": "string" 464 | } 465 | } 466 | } 467 | } 468 | } 469 | }, 470 | "403": { 471 | "description": "Forbidden", 472 | "content": { 473 | "application/json": { 474 | "schema": { 475 | "$ref": "#/components/schemas/Error" 476 | } 477 | } 478 | } 479 | }, 480 | "404": { 481 | "description": "Not found", 482 | "content": { 483 | "application/json": { 484 | "schema": { 485 | "$ref": "#/components/schemas/Error" 486 | } 487 | } 488 | } 489 | }, 490 | "default": { 491 | "description": "unexpected error", 492 | "content": { 493 | "application/json": { 494 | "schema": { 495 | "$ref": "#/components/schemas/Error" 496 | } 497 | } 498 | } 499 | } 500 | }, 501 | "summary": "", 502 | "tags": [ 503 | "UsersPermissions - Role" 504 | ], 505 | "parameters": [ 506 | { 507 | "name": "role", 508 | "in": "path", 509 | "description": "", 510 | "deprecated": false, 511 | "required": true, 512 | "schema": { 513 | "type": "string" 514 | } 515 | } 516 | ] 517 | } 518 | } 519 | }, 520 | "components": { 521 | "schemas": { 522 | "UsersPermissionsRole": { 523 | "required": [ 524 | "id", 525 | "name" 526 | ], 527 | "properties": { 528 | "id": { 529 | "type": "string" 530 | }, 531 | "name": { 532 | "type": "string", 533 | "minLength": 3 534 | }, 535 | "description": { 536 | "type": "string" 537 | }, 538 | "type": { 539 | "type": "string" 540 | }, 541 | "permissions": { 542 | "type": "array", 543 | "items": { 544 | "required": [ 545 | "id", 546 | "type", 547 | "controller", 548 | "action", 549 | "enabled" 550 | ], 551 | "properties": { 552 | "id": { 553 | "type": "string" 554 | }, 555 | "type": { 556 | "type": "string" 557 | }, 558 | "controller": { 559 | "type": "string" 560 | }, 561 | "action": { 562 | "type": "string" 563 | }, 564 | "enabled": { 565 | "type": "boolean" 566 | }, 567 | "policy": { 568 | "type": "string" 569 | }, 570 | "role": { 571 | "type": "string" 572 | } 573 | } 574 | } 575 | }, 576 | "users": { 577 | "type": "array", 578 | "items": { 579 | "required": [ 580 | "id", 581 | "username", 582 | "email" 583 | ], 584 | "properties": { 585 | "id": { 586 | "type": "string" 587 | }, 588 | "username": { 589 | "type": "string" 590 | }, 591 | "email": { 592 | "type": "string" 593 | }, 594 | "provider": { 595 | "type": "string" 596 | }, 597 | "password": { 598 | "type": "string" 599 | }, 600 | "resetPasswordToken": { 601 | "type": "string" 602 | }, 603 | "confirmed": { 604 | "type": "boolean" 605 | }, 606 | "blocked": { 607 | "type": "boolean" 608 | }, 609 | "role": { 610 | "type": "string" 611 | }, 612 | "image": { 613 | "type": "string" 614 | }, 615 | "articles": { 616 | "type": "array", 617 | "items": { 618 | "type": "string" 619 | } 620 | } 621 | } 622 | } 623 | } 624 | } 625 | }, 626 | "NewUsersPermissionsRole": { 627 | "required": [ 628 | "name" 629 | ], 630 | "properties": { 631 | "name": { 632 | "type": "string", 633 | "minLength": 3 634 | }, 635 | "description": { 636 | "type": "string" 637 | }, 638 | "type": { 639 | "type": "string" 640 | }, 641 | "permissions": { 642 | "type": "array", 643 | "items": { 644 | "type": "string" 645 | } 646 | }, 647 | "users": { 648 | "type": "array", 649 | "items": { 650 | "type": "string" 651 | } 652 | } 653 | } 654 | } 655 | } 656 | }, 657 | "tags": [ 658 | { 659 | "name": "UsersPermissions - Role" 660 | } 661 | ] 662 | } -------------------------------------------------------------------------------- /extensions/users-permissions/documentation/1.0.0/users-permissions-User.json: -------------------------------------------------------------------------------- 1 | { 2 | "paths": { 3 | "/users-permissions/search/{id}": { 4 | "get": { 5 | "deprecated": false, 6 | "description": "Search for users", 7 | "responses": { 8 | "200": { 9 | "description": "response", 10 | "content": { 11 | "application/json": { 12 | "schema": { 13 | "type": "array", 14 | "items": { 15 | "$ref": "#/components/schemas/UsersPermissionsUser" 16 | } 17 | } 18 | } 19 | } 20 | }, 21 | "403": { 22 | "description": "Forbidden", 23 | "content": { 24 | "application/json": { 25 | "schema": { 26 | "$ref": "#/components/schemas/Error" 27 | } 28 | } 29 | } 30 | }, 31 | "404": { 32 | "description": "Not found", 33 | "content": { 34 | "application/json": { 35 | "schema": { 36 | "$ref": "#/components/schemas/Error" 37 | } 38 | } 39 | } 40 | }, 41 | "default": { 42 | "description": "unexpected error", 43 | "content": { 44 | "application/json": { 45 | "schema": { 46 | "$ref": "#/components/schemas/Error" 47 | } 48 | } 49 | } 50 | } 51 | }, 52 | "summary": "", 53 | "tags": [ 54 | "UsersPermissions - User" 55 | ], 56 | "parameters": [ 57 | { 58 | "name": "id", 59 | "in": "path", 60 | "description": "", 61 | "deprecated": false, 62 | "required": true, 63 | "schema": { 64 | "type": "string" 65 | } 66 | }, 67 | { 68 | "name": "_limit", 69 | "in": "query", 70 | "required": false, 71 | "description": "Maximum number of results possible", 72 | "schema": { 73 | "type": "integer" 74 | }, 75 | "deprecated": false 76 | }, 77 | { 78 | "name": "_sort", 79 | "in": "query", 80 | "required": false, 81 | "description": "Sort according to a specific field.", 82 | "schema": { 83 | "type": "string" 84 | }, 85 | "deprecated": false 86 | }, 87 | { 88 | "name": "_start", 89 | "in": "query", 90 | "required": false, 91 | "description": "Skip a specific number of entries (especially useful for pagination)", 92 | "schema": { 93 | "type": "integer" 94 | }, 95 | "deprecated": false 96 | }, 97 | { 98 | "name": "=", 99 | "in": "query", 100 | "required": false, 101 | "description": "Get entries that matches exactly your input", 102 | "schema": { 103 | "type": "string" 104 | }, 105 | "deprecated": false 106 | }, 107 | { 108 | "name": "_ne", 109 | "in": "query", 110 | "required": false, 111 | "description": "Get records that are not equals to something", 112 | "schema": { 113 | "type": "string" 114 | }, 115 | "deprecated": false 116 | }, 117 | { 118 | "name": "_lt", 119 | "in": "query", 120 | "required": false, 121 | "description": "Get record that are lower than a value", 122 | "schema": { 123 | "type": "string" 124 | }, 125 | "deprecated": false 126 | }, 127 | { 128 | "name": "_lte", 129 | "in": "query", 130 | "required": false, 131 | "description": "Get records that are lower than or equal to a value", 132 | "schema": { 133 | "type": "string" 134 | }, 135 | "deprecated": false 136 | }, 137 | { 138 | "name": "_gt", 139 | "in": "query", 140 | "required": false, 141 | "description": "Get records that are greater than a value", 142 | "schema": { 143 | "type": "string" 144 | }, 145 | "deprecated": false 146 | }, 147 | { 148 | "name": "_gte", 149 | "in": "query", 150 | "required": false, 151 | "description": "Get records that are greater than or equal a value", 152 | "schema": { 153 | "type": "string" 154 | }, 155 | "deprecated": false 156 | }, 157 | { 158 | "name": "_contains", 159 | "in": "query", 160 | "required": false, 161 | "description": "Get records that contains a value", 162 | "schema": { 163 | "type": "string" 164 | }, 165 | "deprecated": false 166 | }, 167 | { 168 | "name": "_containss", 169 | "in": "query", 170 | "required": false, 171 | "description": "Get records that contains (case sensitive) a value", 172 | "schema": { 173 | "type": "string" 174 | }, 175 | "deprecated": false 176 | }, 177 | { 178 | "name": "_in", 179 | "in": "query", 180 | "required": false, 181 | "description": "Get records that matches any value in the array of values", 182 | "schema": { 183 | "type": "array", 184 | "items": { 185 | "type": "string" 186 | } 187 | }, 188 | "deprecated": false 189 | }, 190 | { 191 | "name": "_nin", 192 | "in": "query", 193 | "required": false, 194 | "description": "Get records that doesn't match any value in the array of values", 195 | "schema": { 196 | "type": "array", 197 | "items": { 198 | "type": "string" 199 | } 200 | }, 201 | "deprecated": false 202 | } 203 | ] 204 | } 205 | }, 206 | "/connect/*": { 207 | "get": { 208 | "deprecated": false, 209 | "description": "Connect a provider", 210 | "responses": { 211 | "200": { 212 | "description": "response", 213 | "content": { 214 | "application/json": { 215 | "schema": { 216 | "properties": { 217 | "foo": { 218 | "type": "string" 219 | } 220 | } 221 | } 222 | } 223 | } 224 | }, 225 | "403": { 226 | "description": "Forbidden", 227 | "content": { 228 | "application/json": { 229 | "schema": { 230 | "$ref": "#/components/schemas/Error" 231 | } 232 | } 233 | } 234 | }, 235 | "404": { 236 | "description": "Not found", 237 | "content": { 238 | "application/json": { 239 | "schema": { 240 | "$ref": "#/components/schemas/Error" 241 | } 242 | } 243 | } 244 | }, 245 | "default": { 246 | "description": "unexpected error", 247 | "content": { 248 | "application/json": { 249 | "schema": { 250 | "$ref": "#/components/schemas/Error" 251 | } 252 | } 253 | } 254 | } 255 | }, 256 | "summary": "", 257 | "tags": [ 258 | "UsersPermissions - User" 259 | ], 260 | "parameters": [] 261 | } 262 | }, 263 | "/auth/local": { 264 | "post": { 265 | "deprecated": false, 266 | "description": "Login a user using the identifiers email and password", 267 | "responses": { 268 | "200": { 269 | "description": "response", 270 | "content": { 271 | "application/json": { 272 | "schema": { 273 | "properties": { 274 | "foo": { 275 | "type": "string" 276 | } 277 | } 278 | } 279 | } 280 | } 281 | }, 282 | "403": { 283 | "description": "Forbidden", 284 | "content": { 285 | "application/json": { 286 | "schema": { 287 | "$ref": "#/components/schemas/Error" 288 | } 289 | } 290 | } 291 | }, 292 | "404": { 293 | "description": "Not found", 294 | "content": { 295 | "application/json": { 296 | "schema": { 297 | "$ref": "#/components/schemas/Error" 298 | } 299 | } 300 | } 301 | }, 302 | "default": { 303 | "description": "unexpected error", 304 | "content": { 305 | "application/json": { 306 | "schema": { 307 | "$ref": "#/components/schemas/Error" 308 | } 309 | } 310 | } 311 | } 312 | }, 313 | "summary": "", 314 | "tags": [ 315 | "UsersPermissions - User" 316 | ], 317 | "requestBody": { 318 | "description": "", 319 | "required": true, 320 | "content": { 321 | "application/json": { 322 | "schema": { 323 | "properties": { 324 | "foo": { 325 | "type": "string" 326 | } 327 | } 328 | } 329 | } 330 | } 331 | } 332 | } 333 | }, 334 | "/auth/local/register": { 335 | "post": { 336 | "deprecated": false, 337 | "description": "Register a new user with the default role", 338 | "responses": { 339 | "200": { 340 | "description": "response", 341 | "content": { 342 | "application/json": { 343 | "schema": { 344 | "$ref": "#/components/schemas/UsersPermissionsUser" 345 | } 346 | } 347 | } 348 | }, 349 | "403": { 350 | "description": "Forbidden", 351 | "content": { 352 | "application/json": { 353 | "schema": { 354 | "$ref": "#/components/schemas/Error" 355 | } 356 | } 357 | } 358 | }, 359 | "404": { 360 | "description": "Not found", 361 | "content": { 362 | "application/json": { 363 | "schema": { 364 | "$ref": "#/components/schemas/Error" 365 | } 366 | } 367 | } 368 | }, 369 | "default": { 370 | "description": "unexpected error", 371 | "content": { 372 | "application/json": { 373 | "schema": { 374 | "$ref": "#/components/schemas/Error" 375 | } 376 | } 377 | } 378 | } 379 | }, 380 | "summary": "", 381 | "tags": [ 382 | "UsersPermissions - User" 383 | ], 384 | "requestBody": { 385 | "description": "", 386 | "required": true, 387 | "content": { 388 | "application/json": { 389 | "schema": { 390 | "$ref": "#/components/schemas/NewUsersPermissionsUser" 391 | } 392 | } 393 | } 394 | } 395 | } 396 | }, 397 | "/auth/{provider}/callback": { 398 | "get": { 399 | "deprecated": false, 400 | "description": "Successfull redirection after approving a provider", 401 | "responses": { 402 | "200": { 403 | "description": "response", 404 | "content": { 405 | "application/json": { 406 | "schema": { 407 | "properties": { 408 | "foo": { 409 | "type": "string" 410 | } 411 | } 412 | } 413 | } 414 | } 415 | }, 416 | "403": { 417 | "description": "Forbidden", 418 | "content": { 419 | "application/json": { 420 | "schema": { 421 | "$ref": "#/components/schemas/Error" 422 | } 423 | } 424 | } 425 | }, 426 | "404": { 427 | "description": "Not found", 428 | "content": { 429 | "application/json": { 430 | "schema": { 431 | "$ref": "#/components/schemas/Error" 432 | } 433 | } 434 | } 435 | }, 436 | "default": { 437 | "description": "unexpected error", 438 | "content": { 439 | "application/json": { 440 | "schema": { 441 | "$ref": "#/components/schemas/Error" 442 | } 443 | } 444 | } 445 | } 446 | }, 447 | "summary": "", 448 | "tags": [ 449 | "UsersPermissions - User" 450 | ], 451 | "parameters": [ 452 | { 453 | "name": "provider", 454 | "in": "path", 455 | "description": "", 456 | "deprecated": false, 457 | "required": true, 458 | "schema": { 459 | "type": "string" 460 | } 461 | } 462 | ] 463 | } 464 | }, 465 | "/auth/forgot-password": { 466 | "post": { 467 | "deprecated": false, 468 | "description": "Send the reset password email link", 469 | "responses": { 470 | "200": { 471 | "description": "response", 472 | "content": { 473 | "application/json": { 474 | "schema": { 475 | "properties": { 476 | "foo": { 477 | "type": "string" 478 | } 479 | } 480 | } 481 | } 482 | } 483 | }, 484 | "403": { 485 | "description": "Forbidden", 486 | "content": { 487 | "application/json": { 488 | "schema": { 489 | "$ref": "#/components/schemas/Error" 490 | } 491 | } 492 | } 493 | }, 494 | "404": { 495 | "description": "Not found", 496 | "content": { 497 | "application/json": { 498 | "schema": { 499 | "$ref": "#/components/schemas/Error" 500 | } 501 | } 502 | } 503 | }, 504 | "default": { 505 | "description": "unexpected error", 506 | "content": { 507 | "application/json": { 508 | "schema": { 509 | "$ref": "#/components/schemas/Error" 510 | } 511 | } 512 | } 513 | } 514 | }, 515 | "summary": "", 516 | "tags": [ 517 | "UsersPermissions - User" 518 | ], 519 | "requestBody": { 520 | "description": "", 521 | "required": true, 522 | "content": { 523 | "application/json": { 524 | "schema": { 525 | "properties": { 526 | "foo": { 527 | "type": "string" 528 | } 529 | } 530 | } 531 | } 532 | } 533 | } 534 | } 535 | }, 536 | "/auth/reset-password": { 537 | "post": { 538 | "deprecated": false, 539 | "description": "Reset user password with a code (resetToken)", 540 | "responses": { 541 | "200": { 542 | "description": "response", 543 | "content": { 544 | "application/json": { 545 | "schema": { 546 | "properties": { 547 | "foo": { 548 | "type": "string" 549 | } 550 | } 551 | } 552 | } 553 | } 554 | }, 555 | "403": { 556 | "description": "Forbidden", 557 | "content": { 558 | "application/json": { 559 | "schema": { 560 | "$ref": "#/components/schemas/Error" 561 | } 562 | } 563 | } 564 | }, 565 | "404": { 566 | "description": "Not found", 567 | "content": { 568 | "application/json": { 569 | "schema": { 570 | "$ref": "#/components/schemas/Error" 571 | } 572 | } 573 | } 574 | }, 575 | "default": { 576 | "description": "unexpected error", 577 | "content": { 578 | "application/json": { 579 | "schema": { 580 | "$ref": "#/components/schemas/Error" 581 | } 582 | } 583 | } 584 | } 585 | }, 586 | "summary": "", 587 | "tags": [ 588 | "UsersPermissions - User" 589 | ], 590 | "requestBody": { 591 | "description": "", 592 | "required": true, 593 | "content": { 594 | "application/json": { 595 | "schema": { 596 | "properties": { 597 | "foo": { 598 | "type": "string" 599 | } 600 | } 601 | } 602 | } 603 | } 604 | } 605 | } 606 | }, 607 | "/auth/email-confirmation": { 608 | "get": { 609 | "deprecated": false, 610 | "description": "Validate a user account", 611 | "responses": { 612 | "200": { 613 | "description": "response", 614 | "content": { 615 | "application/json": { 616 | "schema": { 617 | "properties": { 618 | "foo": { 619 | "type": "string" 620 | } 621 | } 622 | } 623 | } 624 | } 625 | }, 626 | "403": { 627 | "description": "Forbidden", 628 | "content": { 629 | "application/json": { 630 | "schema": { 631 | "$ref": "#/components/schemas/Error" 632 | } 633 | } 634 | } 635 | }, 636 | "404": { 637 | "description": "Not found", 638 | "content": { 639 | "application/json": { 640 | "schema": { 641 | "$ref": "#/components/schemas/Error" 642 | } 643 | } 644 | } 645 | }, 646 | "default": { 647 | "description": "unexpected error", 648 | "content": { 649 | "application/json": { 650 | "schema": { 651 | "$ref": "#/components/schemas/Error" 652 | } 653 | } 654 | } 655 | } 656 | }, 657 | "summary": "", 658 | "tags": [ 659 | "UsersPermissions - User" 660 | ], 661 | "parameters": [] 662 | } 663 | }, 664 | "/auth/send-email-confirmation": { 665 | "post": { 666 | "deprecated": false, 667 | "description": "Send a confirmation email to user", 668 | "responses": { 669 | "200": { 670 | "description": "response", 671 | "content": { 672 | "application/json": { 673 | "schema": { 674 | "properties": { 675 | "foo": { 676 | "type": "string" 677 | } 678 | } 679 | } 680 | } 681 | } 682 | }, 683 | "403": { 684 | "description": "Forbidden", 685 | "content": { 686 | "application/json": { 687 | "schema": { 688 | "$ref": "#/components/schemas/Error" 689 | } 690 | } 691 | } 692 | }, 693 | "404": { 694 | "description": "Not found", 695 | "content": { 696 | "application/json": { 697 | "schema": { 698 | "$ref": "#/components/schemas/Error" 699 | } 700 | } 701 | } 702 | }, 703 | "default": { 704 | "description": "unexpected error", 705 | "content": { 706 | "application/json": { 707 | "schema": { 708 | "$ref": "#/components/schemas/Error" 709 | } 710 | } 711 | } 712 | } 713 | }, 714 | "summary": "", 715 | "tags": [ 716 | "UsersPermissions - User" 717 | ], 718 | "requestBody": { 719 | "description": "", 720 | "required": true, 721 | "content": { 722 | "application/json": { 723 | "schema": { 724 | "properties": { 725 | "foo": { 726 | "type": "string" 727 | } 728 | } 729 | } 730 | } 731 | } 732 | } 733 | } 734 | }, 735 | "/users": { 736 | "get": { 737 | "deprecated": false, 738 | "description": "Retrieve all user documents", 739 | "responses": { 740 | "200": { 741 | "description": "response", 742 | "content": { 743 | "application/json": { 744 | "schema": { 745 | "type": "array", 746 | "items": { 747 | "$ref": "#/components/schemas/UsersPermissionsUser" 748 | } 749 | } 750 | } 751 | } 752 | }, 753 | "403": { 754 | "description": "Forbidden", 755 | "content": { 756 | "application/json": { 757 | "schema": { 758 | "$ref": "#/components/schemas/Error" 759 | } 760 | } 761 | } 762 | }, 763 | "404": { 764 | "description": "Not found", 765 | "content": { 766 | "application/json": { 767 | "schema": { 768 | "$ref": "#/components/schemas/Error" 769 | } 770 | } 771 | } 772 | }, 773 | "default": { 774 | "description": "unexpected error", 775 | "content": { 776 | "application/json": { 777 | "schema": { 778 | "$ref": "#/components/schemas/Error" 779 | } 780 | } 781 | } 782 | } 783 | }, 784 | "summary": "", 785 | "tags": [ 786 | "UsersPermissions - User" 787 | ], 788 | "parameters": [ 789 | { 790 | "name": "_limit", 791 | "in": "query", 792 | "required": false, 793 | "description": "Maximum number of results possible", 794 | "schema": { 795 | "type": "integer" 796 | }, 797 | "deprecated": false 798 | }, 799 | { 800 | "name": "_sort", 801 | "in": "query", 802 | "required": false, 803 | "description": "Sort according to a specific field.", 804 | "schema": { 805 | "type": "string" 806 | }, 807 | "deprecated": false 808 | }, 809 | { 810 | "name": "_start", 811 | "in": "query", 812 | "required": false, 813 | "description": "Skip a specific number of entries (especially useful for pagination)", 814 | "schema": { 815 | "type": "integer" 816 | }, 817 | "deprecated": false 818 | }, 819 | { 820 | "name": "=", 821 | "in": "query", 822 | "required": false, 823 | "description": "Get entries that matches exactly your input", 824 | "schema": { 825 | "type": "string" 826 | }, 827 | "deprecated": false 828 | }, 829 | { 830 | "name": "_ne", 831 | "in": "query", 832 | "required": false, 833 | "description": "Get records that are not equals to something", 834 | "schema": { 835 | "type": "string" 836 | }, 837 | "deprecated": false 838 | }, 839 | { 840 | "name": "_lt", 841 | "in": "query", 842 | "required": false, 843 | "description": "Get record that are lower than a value", 844 | "schema": { 845 | "type": "string" 846 | }, 847 | "deprecated": false 848 | }, 849 | { 850 | "name": "_lte", 851 | "in": "query", 852 | "required": false, 853 | "description": "Get records that are lower than or equal to a value", 854 | "schema": { 855 | "type": "string" 856 | }, 857 | "deprecated": false 858 | }, 859 | { 860 | "name": "_gt", 861 | "in": "query", 862 | "required": false, 863 | "description": "Get records that are greater than a value", 864 | "schema": { 865 | "type": "string" 866 | }, 867 | "deprecated": false 868 | }, 869 | { 870 | "name": "_gte", 871 | "in": "query", 872 | "required": false, 873 | "description": "Get records that are greater than or equal a value", 874 | "schema": { 875 | "type": "string" 876 | }, 877 | "deprecated": false 878 | }, 879 | { 880 | "name": "_contains", 881 | "in": "query", 882 | "required": false, 883 | "description": "Get records that contains a value", 884 | "schema": { 885 | "type": "string" 886 | }, 887 | "deprecated": false 888 | }, 889 | { 890 | "name": "_containss", 891 | "in": "query", 892 | "required": false, 893 | "description": "Get records that contains (case sensitive) a value", 894 | "schema": { 895 | "type": "string" 896 | }, 897 | "deprecated": false 898 | }, 899 | { 900 | "name": "_in", 901 | "in": "query", 902 | "required": false, 903 | "description": "Get records that matches any value in the array of values", 904 | "schema": { 905 | "type": "array", 906 | "items": { 907 | "type": "string" 908 | } 909 | }, 910 | "deprecated": false 911 | }, 912 | { 913 | "name": "_nin", 914 | "in": "query", 915 | "required": false, 916 | "description": "Get records that doesn't match any value in the array of values", 917 | "schema": { 918 | "type": "array", 919 | "items": { 920 | "type": "string" 921 | } 922 | }, 923 | "deprecated": false 924 | } 925 | ] 926 | } 927 | }, 928 | "/users/me": { 929 | "get": { 930 | "deprecated": false, 931 | "description": "Retrieve the logged in user information", 932 | "responses": { 933 | "200": { 934 | "description": "response", 935 | "content": { 936 | "application/json": { 937 | "schema": { 938 | "$ref": "#/components/schemas/UsersPermissionsUser" 939 | } 940 | } 941 | } 942 | }, 943 | "403": { 944 | "description": "Forbidden", 945 | "content": { 946 | "application/json": { 947 | "schema": { 948 | "$ref": "#/components/schemas/Error" 949 | } 950 | } 951 | } 952 | }, 953 | "404": { 954 | "description": "Not found", 955 | "content": { 956 | "application/json": { 957 | "schema": { 958 | "$ref": "#/components/schemas/Error" 959 | } 960 | } 961 | } 962 | }, 963 | "default": { 964 | "description": "unexpected error", 965 | "content": { 966 | "application/json": { 967 | "schema": { 968 | "$ref": "#/components/schemas/Error" 969 | } 970 | } 971 | } 972 | } 973 | }, 974 | "summary": "", 975 | "tags": [ 976 | "UsersPermissions - User" 977 | ], 978 | "parameters": [] 979 | } 980 | }, 981 | "/users/{id}": { 982 | "get": { 983 | "deprecated": false, 984 | "description": "Retrieve a single user depending on his id", 985 | "responses": { 986 | "200": { 987 | "description": "response", 988 | "content": { 989 | "application/json": { 990 | "schema": { 991 | "$ref": "#/components/schemas/UsersPermissionsUser" 992 | } 993 | } 994 | } 995 | }, 996 | "403": { 997 | "description": "Forbidden", 998 | "content": { 999 | "application/json": { 1000 | "schema": { 1001 | "$ref": "#/components/schemas/Error" 1002 | } 1003 | } 1004 | } 1005 | }, 1006 | "404": { 1007 | "description": "Not found", 1008 | "content": { 1009 | "application/json": { 1010 | "schema": { 1011 | "$ref": "#/components/schemas/Error" 1012 | } 1013 | } 1014 | } 1015 | }, 1016 | "default": { 1017 | "description": "unexpected error", 1018 | "content": { 1019 | "application/json": { 1020 | "schema": { 1021 | "$ref": "#/components/schemas/Error" 1022 | } 1023 | } 1024 | } 1025 | } 1026 | }, 1027 | "summary": "", 1028 | "tags": [ 1029 | "UsersPermissions - User" 1030 | ], 1031 | "parameters": [ 1032 | { 1033 | "name": "id", 1034 | "in": "path", 1035 | "description": "", 1036 | "deprecated": false, 1037 | "required": true, 1038 | "schema": { 1039 | "type": "string" 1040 | } 1041 | } 1042 | ] 1043 | }, 1044 | "put": { 1045 | "deprecated": false, 1046 | "description": "Update an existing user", 1047 | "responses": { 1048 | "200": { 1049 | "description": "response", 1050 | "content": { 1051 | "application/json": { 1052 | "schema": { 1053 | "$ref": "#/components/schemas/UsersPermissionsUser" 1054 | } 1055 | } 1056 | } 1057 | }, 1058 | "403": { 1059 | "description": "Forbidden", 1060 | "content": { 1061 | "application/json": { 1062 | "schema": { 1063 | "$ref": "#/components/schemas/Error" 1064 | } 1065 | } 1066 | } 1067 | }, 1068 | "404": { 1069 | "description": "Not found", 1070 | "content": { 1071 | "application/json": { 1072 | "schema": { 1073 | "$ref": "#/components/schemas/Error" 1074 | } 1075 | } 1076 | } 1077 | }, 1078 | "default": { 1079 | "description": "unexpected error", 1080 | "content": { 1081 | "application/json": { 1082 | "schema": { 1083 | "$ref": "#/components/schemas/Error" 1084 | } 1085 | } 1086 | } 1087 | } 1088 | }, 1089 | "summary": "", 1090 | "tags": [ 1091 | "UsersPermissions - User" 1092 | ], 1093 | "parameters": [ 1094 | { 1095 | "name": "id", 1096 | "in": "path", 1097 | "description": "", 1098 | "deprecated": false, 1099 | "required": true, 1100 | "schema": { 1101 | "type": "string" 1102 | } 1103 | } 1104 | ], 1105 | "requestBody": { 1106 | "description": "", 1107 | "required": true, 1108 | "content": { 1109 | "application/json": { 1110 | "schema": { 1111 | "$ref": "#/components/schemas/NewUsersPermissionsUser" 1112 | } 1113 | } 1114 | } 1115 | } 1116 | }, 1117 | "delete": { 1118 | "deprecated": false, 1119 | "description": "Delete an existing user", 1120 | "responses": { 1121 | "200": { 1122 | "description": "response", 1123 | "content": { 1124 | "application/json": { 1125 | "schema": { 1126 | "properties": { 1127 | "foo": { 1128 | "type": "string" 1129 | } 1130 | } 1131 | } 1132 | } 1133 | } 1134 | }, 1135 | "403": { 1136 | "description": "Forbidden", 1137 | "content": { 1138 | "application/json": { 1139 | "schema": { 1140 | "$ref": "#/components/schemas/Error" 1141 | } 1142 | } 1143 | } 1144 | }, 1145 | "404": { 1146 | "description": "Not found", 1147 | "content": { 1148 | "application/json": { 1149 | "schema": { 1150 | "$ref": "#/components/schemas/Error" 1151 | } 1152 | } 1153 | } 1154 | }, 1155 | "default": { 1156 | "description": "unexpected error", 1157 | "content": { 1158 | "application/json": { 1159 | "schema": { 1160 | "$ref": "#/components/schemas/Error" 1161 | } 1162 | } 1163 | } 1164 | } 1165 | }, 1166 | "summary": "", 1167 | "tags": [ 1168 | "UsersPermissions - User" 1169 | ], 1170 | "parameters": [ 1171 | { 1172 | "name": "id", 1173 | "in": "path", 1174 | "description": "", 1175 | "deprecated": false, 1176 | "required": true, 1177 | "schema": { 1178 | "type": "string" 1179 | } 1180 | } 1181 | ] 1182 | } 1183 | } 1184 | }, 1185 | "components": { 1186 | "schemas": { 1187 | "UsersPermissionsUser": { 1188 | "required": [ 1189 | "id", 1190 | "username", 1191 | "email" 1192 | ], 1193 | "properties": { 1194 | "id": { 1195 | "type": "string" 1196 | }, 1197 | "username": { 1198 | "type": "string", 1199 | "minLength": 3 1200 | }, 1201 | "email": { 1202 | "type": "string", 1203 | "minLength": 6 1204 | }, 1205 | "provider": { 1206 | "type": "string" 1207 | }, 1208 | "confirmed": { 1209 | "type": "boolean", 1210 | "default": false 1211 | }, 1212 | "blocked": { 1213 | "type": "boolean", 1214 | "default": false 1215 | }, 1216 | "role": { 1217 | "required": [ 1218 | "id", 1219 | "name" 1220 | ], 1221 | "properties": { 1222 | "id": { 1223 | "type": "string" 1224 | }, 1225 | "name": { 1226 | "type": "string" 1227 | }, 1228 | "description": { 1229 | "type": "string" 1230 | }, 1231 | "type": { 1232 | "type": "string" 1233 | }, 1234 | "permissions": { 1235 | "type": "array", 1236 | "items": { 1237 | "type": "string" 1238 | } 1239 | }, 1240 | "users": { 1241 | "type": "array", 1242 | "items": { 1243 | "type": "string" 1244 | } 1245 | } 1246 | } 1247 | }, 1248 | "image": { 1249 | "required": [ 1250 | "id", 1251 | "name", 1252 | "hash", 1253 | "mime", 1254 | "size", 1255 | "url", 1256 | "provider" 1257 | ], 1258 | "properties": { 1259 | "id": { 1260 | "type": "string" 1261 | }, 1262 | "name": { 1263 | "type": "string" 1264 | }, 1265 | "alternativeText": { 1266 | "type": "string" 1267 | }, 1268 | "caption": { 1269 | "type": "string" 1270 | }, 1271 | "width": { 1272 | "type": "integer" 1273 | }, 1274 | "height": { 1275 | "type": "integer" 1276 | }, 1277 | "formats": { 1278 | "type": "object" 1279 | }, 1280 | "hash": { 1281 | "type": "string" 1282 | }, 1283 | "ext": { 1284 | "type": "string" 1285 | }, 1286 | "mime": { 1287 | "type": "string" 1288 | }, 1289 | "size": { 1290 | "type": "number" 1291 | }, 1292 | "url": { 1293 | "type": "string" 1294 | }, 1295 | "previewUrl": { 1296 | "type": "string" 1297 | }, 1298 | "provider": { 1299 | "type": "string" 1300 | }, 1301 | "provider_metadata": { 1302 | "type": "object" 1303 | }, 1304 | "related": { 1305 | "type": "string" 1306 | } 1307 | } 1308 | }, 1309 | "articles": { 1310 | "type": "array", 1311 | "items": { 1312 | "required": [ 1313 | "id" 1314 | ], 1315 | "properties": { 1316 | "id": { 1317 | "type": "string" 1318 | }, 1319 | "title": { 1320 | "type": "string" 1321 | }, 1322 | "description": { 1323 | "type": "string" 1324 | }, 1325 | "content": { 1326 | "type": "string" 1327 | }, 1328 | "source": { 1329 | "type": "string" 1330 | }, 1331 | "image": { 1332 | "type": "string" 1333 | }, 1334 | "category": { 1335 | "type": "string" 1336 | }, 1337 | "users": { 1338 | "type": "array", 1339 | "items": { 1340 | "type": "string" 1341 | } 1342 | } 1343 | } 1344 | } 1345 | } 1346 | } 1347 | }, 1348 | "NewUsersPermissionsUser": { 1349 | "required": [ 1350 | "username", 1351 | "email" 1352 | ], 1353 | "properties": { 1354 | "username": { 1355 | "type": "string", 1356 | "minLength": 3 1357 | }, 1358 | "email": { 1359 | "type": "string", 1360 | "minLength": 6 1361 | }, 1362 | "provider": { 1363 | "type": "string" 1364 | }, 1365 | "password": { 1366 | "type": "string", 1367 | "minLength": 6 1368 | }, 1369 | "resetPasswordToken": { 1370 | "type": "string" 1371 | }, 1372 | "confirmed": { 1373 | "type": "boolean", 1374 | "default": false 1375 | }, 1376 | "blocked": { 1377 | "type": "boolean", 1378 | "default": false 1379 | }, 1380 | "role": { 1381 | "type": "string" 1382 | }, 1383 | "articles": { 1384 | "type": "array", 1385 | "items": { 1386 | "type": "string" 1387 | } 1388 | } 1389 | } 1390 | } 1391 | } 1392 | }, 1393 | "tags": [ 1394 | { 1395 | "name": "UsersPermissions - User" 1396 | } 1397 | ] 1398 | } -------------------------------------------------------------------------------- /extensions/users-permissions/models/User.settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "kind": "collectionType", 3 | "collectionName": "users-permissions_user", 4 | "info": { 5 | "name": "user", 6 | "description": "" 7 | }, 8 | "options": { 9 | "timestamps": true 10 | }, 11 | "attributes": { 12 | "username": { 13 | "type": "string", 14 | "minLength": 3, 15 | "unique": true, 16 | "configurable": false, 17 | "required": true 18 | }, 19 | "email": { 20 | "type": "email", 21 | "minLength": 6, 22 | "configurable": false, 23 | "required": true 24 | }, 25 | "provider": { 26 | "type": "string", 27 | "configurable": false 28 | }, 29 | "password": { 30 | "type": "password", 31 | "minLength": 6, 32 | "configurable": false, 33 | "private": true 34 | }, 35 | "resetPasswordToken": { 36 | "type": "string", 37 | "configurable": false, 38 | "private": true 39 | }, 40 | "confirmed": { 41 | "type": "boolean", 42 | "default": false, 43 | "configurable": false 44 | }, 45 | "blocked": { 46 | "type": "boolean", 47 | "default": false, 48 | "configurable": false 49 | }, 50 | "role": { 51 | "model": "role", 52 | "via": "users", 53 | "plugin": "users-permissions", 54 | "configurable": false 55 | }, 56 | "image": { 57 | "model": "file", 58 | "via": "related", 59 | "allowedTypes": [ 60 | "images" 61 | ], 62 | "plugin": "upload", 63 | "required": false 64 | }, 65 | "articles": { 66 | "collection": "article", 67 | "via": "users", 68 | "dominant": true 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devdizer/Strapi-mongodb-cloudinary/c868d05bc21cbae3c1bc89b429d1ebdf90720eef/favicon.ico -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "strapi-mongodb", 3 | "private": true, 4 | "version": "0.1.0", 5 | "description": "A Strapi application", 6 | "scripts": { 7 | "develop": "strapi develop", 8 | "start": "strapi start", 9 | "build": "strapi build", 10 | "strapi": "strapi" 11 | }, 12 | "devDependencies": {}, 13 | "dependencies": { 14 | "strapi": "3.0.4", 15 | "strapi-admin": "3.0.4", 16 | "strapi-connector-mongoose": "3.0.4", 17 | "strapi-plugin-content-manager": "3.0.4", 18 | "strapi-plugin-content-type-builder": "3.0.4", 19 | "strapi-plugin-documentation": "3.0.4", 20 | "strapi-plugin-email": "3.0.4", 21 | "strapi-plugin-graphql": "3.0.4", 22 | "strapi-plugin-upload": "3.0.4", 23 | "strapi-plugin-users-permissions": "3.0.4", 24 | "strapi-provider-upload-aws-s3": "^3.0.4", 25 | "strapi-provider-upload-cloudinary": "^3.0.4", 26 | "strapi-provider-upload-local": "^3.0.4", 27 | "strapi-utils": "3.0.4" 28 | }, 29 | "author": { 30 | "name": "A Strapi developer" 31 | }, 32 | "strapi": { 33 | "uuid": "7d600e0c-3674-4e3e-b49f-16b1a6c20bc8" 34 | }, 35 | "engines": { 36 | "node": ">=10.0.0", 37 | "npm": ">=6.0.0" 38 | }, 39 | "license": "MIT" 40 | } 41 | -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | # To prevent search engines from seeing the site altogether, uncomment the next two lines: 2 | # User-Agent: * 3 | # Disallow: / 4 | -------------------------------------------------------------------------------- /public/uploads/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devdizer/Strapi-mongodb-cloudinary/c868d05bc21cbae3c1bc89b429d1ebdf90720eef/public/uploads/.gitkeep --------------------------------------------------------------------------------