@strapi/strapi 4.2.1-alpha.0 → 4.3.0-beta.2

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 (90) hide show
  1. package/bin/strapi.js +19 -1
  2. package/lib/Strapi.js +37 -8
  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/generate-types.js +20 -0
  13. package/lib/commands/content-types/list.js +2 -1
  14. package/lib/commands/controllers/list.js +2 -1
  15. package/lib/commands/develop.js +111 -74
  16. package/lib/commands/hooks/list.js +2 -1
  17. package/lib/commands/middlewares/list.js +2 -1
  18. package/lib/commands/opt-in-telemetry.js +100 -0
  19. package/lib/commands/policies/list.js +2 -1
  20. package/lib/commands/routes/list.js +2 -1
  21. package/lib/commands/services/list.js +2 -1
  22. package/lib/commands/start.js +18 -2
  23. package/lib/commands/watchAdmin.js +5 -10
  24. package/lib/compile.js +20 -0
  25. package/lib/core/app-configuration/config-loader.js +3 -1
  26. package/lib/core/app-configuration/index.js +4 -3
  27. package/lib/core/app-configuration/load-config-file.js +3 -1
  28. package/lib/core/bootstrap.js +2 -2
  29. package/lib/core/loaders/apis.js +6 -5
  30. package/lib/core/loaders/components.js +5 -4
  31. package/lib/core/loaders/middlewares.js +4 -2
  32. package/lib/core/loaders/plugins/get-enabled-plugins.js +2 -1
  33. package/lib/core/loaders/plugins/get-user-plugins-config.js +2 -2
  34. package/lib/core/loaders/plugins/index.js +1 -1
  35. package/lib/core/loaders/policies.js +4 -2
  36. package/lib/core/loaders/src-index.js +6 -4
  37. package/lib/core/registries/policies.d.ts +1 -1
  38. package/lib/core-api/controller/index.d.ts +16 -14
  39. package/lib/core-api/service/index.d.ts +10 -9
  40. package/lib/global.d.ts +61 -0
  41. package/lib/index.d.ts +2 -24
  42. package/lib/index.js +1 -0
  43. package/lib/load/load-files.js +3 -1
  44. package/lib/middlewares/favicon.js +1 -1
  45. package/lib/middlewares/public/index.js +1 -1
  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 +370 -0
  81. package/lib/types/factories.d.ts +52 -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/update-notifier/index.js +1 -1
  89. package/package.json +19 -17
  90. package/lib/factories.d.ts +0 -48
@@ -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;