@strapi/strapi 4.2.3 → 4.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/bin/strapi.js +13 -0
  2. package/lib/Strapi.js +41 -10
  3. package/lib/commands/admin-create.js +2 -1
  4. package/lib/commands/admin-reset.js +2 -1
  5. package/lib/commands/build.js +8 -46
  6. package/lib/commands/builders/admin.js +56 -0
  7. package/lib/commands/builders/index.js +9 -0
  8. package/lib/commands/builders/typescript.js +32 -0
  9. package/lib/commands/configurationDump.js +2 -1
  10. package/lib/commands/configurationRestore.js +3 -1
  11. package/lib/commands/console.js +4 -3
  12. package/lib/commands/content-types/list.js +2 -1
  13. package/lib/commands/controllers/list.js +2 -1
  14. package/lib/commands/develop.js +111 -74
  15. package/lib/commands/hooks/list.js +2 -1
  16. package/lib/commands/middlewares/list.js +2 -1
  17. package/lib/commands/policies/list.js +2 -1
  18. package/lib/commands/routes/list.js +2 -1
  19. package/lib/commands/services/list.js +2 -1
  20. package/lib/commands/start.js +18 -2
  21. package/lib/commands/ts/generate-types.js +26 -0
  22. package/lib/commands/watchAdmin.js +5 -10
  23. package/lib/compile.js +20 -0
  24. package/lib/core/app-configuration/index.js +4 -3
  25. package/lib/core/app-configuration/load-config-file.js +3 -1
  26. package/lib/core/bootstrap.js +2 -2
  27. package/lib/core/domain/content-type/validator.js +29 -8
  28. package/lib/core/loaders/apis.js +6 -5
  29. package/lib/core/loaders/components.js +5 -4
  30. package/lib/core/loaders/middlewares.js +4 -2
  31. package/lib/core/loaders/plugins/get-enabled-plugins.js +2 -1
  32. package/lib/core/loaders/plugins/get-user-plugins-config.js +2 -2
  33. package/lib/core/loaders/plugins/index.js +1 -1
  34. package/lib/core/loaders/policies.js +4 -2
  35. package/lib/core/loaders/src-index.js +6 -4
  36. package/lib/core/registries/policies.d.ts +1 -1
  37. package/lib/core-api/controller/index.d.ts +16 -14
  38. package/lib/core-api/service/index.d.ts +10 -9
  39. package/lib/global.d.ts +61 -0
  40. package/lib/index.d.ts +2 -24
  41. package/lib/index.js +1 -0
  42. package/lib/load/load-files.js +3 -1
  43. package/lib/middlewares/favicon.js +1 -1
  44. package/lib/middlewares/public/index.js +1 -1
  45. package/lib/services/cron.js +7 -3
  46. package/lib/services/entity-service/index.d.ts +7 -1
  47. package/lib/services/entity-service/index.js +11 -1
  48. package/lib/services/fs.js +1 -1
  49. package/lib/services/metrics/index.js +5 -1
  50. package/lib/services/metrics/sender.js +7 -0
  51. package/lib/services/server/middleware.js +1 -1
  52. package/lib/services/utils/upload-files.js +1 -1
  53. package/lib/types/core/attributes/base.d.ts +74 -0
  54. package/lib/types/core/attributes/biginteger.d.ts +22 -0
  55. package/lib/types/core/attributes/boolean.d.ts +20 -0
  56. package/lib/types/core/attributes/common.d.ts +42 -0
  57. package/lib/types/core/attributes/component.d.ts +41 -0
  58. package/lib/types/core/attributes/date-time.d.ts +22 -0
  59. package/lib/types/core/attributes/date.d.ts +22 -0
  60. package/lib/types/core/attributes/decimal.d.ts +22 -0
  61. package/lib/types/core/attributes/dynamic-zone.d.ts +29 -0
  62. package/lib/types/core/attributes/email.d.ts +24 -0
  63. package/lib/types/core/attributes/enumeration.d.ts +28 -0
  64. package/lib/types/core/attributes/float.d.ts +22 -0
  65. package/lib/types/core/attributes/index.d.ts +26 -0
  66. package/lib/types/core/attributes/integer.d.ts +22 -0
  67. package/lib/types/core/attributes/json.d.ts +14 -0
  68. package/lib/types/core/attributes/media.d.ts +36 -0
  69. package/lib/types/core/attributes/password.d.ts +22 -0
  70. package/lib/types/core/attributes/relation.d.ts +66 -0
  71. package/lib/types/core/attributes/richtext.d.ts +22 -0
  72. package/lib/types/core/attributes/string.d.ts +30 -0
  73. package/lib/types/core/attributes/text.d.ts +30 -0
  74. package/lib/types/core/attributes/time.d.ts +22 -0
  75. package/lib/types/core/attributes/timestamp.d.ts +22 -0
  76. package/lib/types/core/attributes/uid.d.ts +57 -0
  77. package/lib/types/core/attributes/utils.d.ts +99 -0
  78. package/lib/types/core/index.d.ts +3 -0
  79. package/lib/types/core/schemas/index.d.ts +126 -0
  80. package/lib/types/core/strapi/index.d.ts +391 -0
  81. package/lib/types/factories.d.ts +60 -0
  82. package/lib/types/index.d.ts +4 -0
  83. package/lib/types/utils.d.ts +95 -0
  84. package/lib/utils/get-dirs.js +24 -10
  85. package/lib/utils/import-default.js +10 -0
  86. package/lib/utils/index.js +2 -0
  87. package/lib/utils/lifecycles.js +15 -0
  88. package/lib/utils/machine-id.js +2 -2
  89. package/lib/utils/update-notifier/index.js +1 -1
  90. package/package.json +18 -16
  91. package/lib/factories.d.ts +0 -48
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@strapi/strapi",
3
- "version": "4.2.3",
3
+ "version": "4.3.0",
4
4
  "description": "An open source headless CMS solution to create and manage your own API. It provides a powerful dashboard and features to make your life easier. Databases supported: MySQL, MariaDB, PostgreSQL, SQLite",
5
5
  "keywords": [
6
6
  "strapi",
@@ -80,16 +80,17 @@
80
80
  "dependencies": {
81
81
  "@koa/cors": "3.1.0",
82
82
  "@koa/router": "10.1.1",
83
- "@strapi/admin": "4.2.3",
84
- "@strapi/database": "4.2.3",
85
- "@strapi/generate-new": "4.2.3",
86
- "@strapi/generators": "4.2.3",
87
- "@strapi/logger": "4.2.3",
88
- "@strapi/plugin-content-manager": "4.2.3",
89
- "@strapi/plugin-content-type-builder": "4.2.3",
90
- "@strapi/plugin-email": "4.2.3",
91
- "@strapi/plugin-upload": "4.2.3",
92
- "@strapi/utils": "4.2.3",
83
+ "@strapi/admin": "4.3.0",
84
+ "@strapi/database": "4.3.0",
85
+ "@strapi/generate-new": "4.3.0",
86
+ "@strapi/generators": "4.3.0",
87
+ "@strapi/logger": "4.3.0",
88
+ "@strapi/plugin-content-manager": "4.3.0",
89
+ "@strapi/plugin-content-type-builder": "4.3.0",
90
+ "@strapi/plugin-email": "4.3.0",
91
+ "@strapi/plugin-upload": "4.3.0",
92
+ "@strapi/typescript-utils": "4.3.0",
93
+ "@strapi/utils": "4.3.0",
93
94
  "bcryptjs": "2.4.3",
94
95
  "boxen": "5.1.2",
95
96
  "chalk": "4.1.2",
@@ -107,7 +108,7 @@
107
108
  "http-errors": "1.8.1",
108
109
  "inquirer": "8.2.4",
109
110
  "is-docker": "2.2.1",
110
- "koa": "2.13.3",
111
+ "koa": "2.13.4",
111
112
  "koa-body": "4.2.0",
112
113
  "koa-compose": "4.1.0",
113
114
  "koa-compress": "5.1.0",
@@ -120,7 +121,7 @@
120
121
  "mime-types": "2.1.35",
121
122
  "node-fetch": "2.6.7",
122
123
  "node-machine-id": "1.1.12",
123
- "node-schedule": "2.0.0",
124
+ "node-schedule": "2.1.0",
124
125
  "open": "8.4.0",
125
126
  "ora": "5.4.1",
126
127
  "package-json": "7.0.0",
@@ -128,14 +129,15 @@
128
129
  "resolve-cwd": "3.0.0",
129
130
  "semver": "7.3.7",
130
131
  "statuses": "2.0.1",
131
- "uuid": "^3.3.2"
132
+ "uuid": "^8.3.2"
132
133
  },
133
134
  "devDependencies": {
134
- "supertest": "6.2.4"
135
+ "supertest": "6.2.4",
136
+ "typescript": "4.6.2"
135
137
  },
136
138
  "engines": {
137
139
  "node": ">=14.19.1 <=16.x.x",
138
140
  "npm": ">=6.0.0"
139
141
  },
140
- "gitHead": "fe296baf71cb932d45183d5335285eaf30a6fad6"
142
+ "gitHead": "74a2b908df75bc8001d72f9dc8571c4b7a2da337"
141
143
  }
@@ -1,48 +0,0 @@
1
- import { Service } from './core-api/service';
2
- import { Controller } from './core-api/controller';
3
- import { Middleware } from './middlewares';
4
- import { Policy } from './core/registries/policies';
5
-
6
- type ControllerConfig = Controller;
7
-
8
- type ServiceConfig = Service;
9
-
10
- type HandlerConfig = {
11
- auth: false | { scope: string[] };
12
- policies: Array<string | Policy>;
13
- middlewares: Array<string | Middleware>;
14
- };
15
-
16
- type SingleTypeRouterConfig = {
17
- find: HandlerConfig;
18
- update: HandlerConfig;
19
- delete: HandlerConfig;
20
- };
21
-
22
- type CollectionTypeRouterConfig = {
23
- find: HandlerConfig;
24
- findOne: HandlerConfig;
25
- create: HandlerConfig;
26
- update: HandlerConfig;
27
- delete: HandlerConfig;
28
- };
29
-
30
- type RouterConfig = {
31
- prefix: string;
32
- only: string[];
33
- except: string[];
34
- config: SingleTypeRouterConfig | CollectionTypeRouterConfig;
35
- };
36
-
37
- interface Route {
38
- method: string;
39
- path: string;
40
- }
41
- interface Router {
42
- prefix: string;
43
- routes: Route[];
44
- }
45
-
46
- export function createCoreRouter(uid: string, cfg: RouterConfig): () => Router;
47
- export function createCoreController(uid: string, cfg: ControllerConfig): () => Controller;
48
- export function createCoreService(uid: string, cfg: ServiceConfig): () => Service;