@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.
- package/bin/strapi.js +19 -1
- package/lib/Strapi.js +37 -8
- package/lib/commands/admin-create.js +2 -1
- package/lib/commands/admin-reset.js +2 -1
- package/lib/commands/build.js +8 -46
- package/lib/commands/builders/admin.js +56 -0
- package/lib/commands/builders/index.js +9 -0
- package/lib/commands/builders/typescript.js +32 -0
- package/lib/commands/configurationDump.js +2 -1
- package/lib/commands/configurationRestore.js +3 -1
- package/lib/commands/console.js +4 -3
- package/lib/commands/content-types/generate-types.js +20 -0
- package/lib/commands/content-types/list.js +2 -1
- package/lib/commands/controllers/list.js +2 -1
- package/lib/commands/develop.js +111 -74
- package/lib/commands/hooks/list.js +2 -1
- package/lib/commands/middlewares/list.js +2 -1
- package/lib/commands/opt-in-telemetry.js +100 -0
- package/lib/commands/policies/list.js +2 -1
- package/lib/commands/routes/list.js +2 -1
- package/lib/commands/services/list.js +2 -1
- package/lib/commands/start.js +18 -2
- package/lib/commands/watchAdmin.js +5 -10
- package/lib/compile.js +20 -0
- package/lib/core/app-configuration/config-loader.js +3 -1
- package/lib/core/app-configuration/index.js +4 -3
- package/lib/core/app-configuration/load-config-file.js +3 -1
- package/lib/core/bootstrap.js +2 -2
- package/lib/core/loaders/apis.js +6 -5
- package/lib/core/loaders/components.js +5 -4
- package/lib/core/loaders/middlewares.js +4 -2
- package/lib/core/loaders/plugins/get-enabled-plugins.js +2 -1
- package/lib/core/loaders/plugins/get-user-plugins-config.js +2 -2
- package/lib/core/loaders/plugins/index.js +1 -1
- package/lib/core/loaders/policies.js +4 -2
- package/lib/core/loaders/src-index.js +6 -4
- package/lib/core/registries/policies.d.ts +1 -1
- package/lib/core-api/controller/index.d.ts +16 -14
- package/lib/core-api/service/index.d.ts +10 -9
- package/lib/global.d.ts +61 -0
- package/lib/index.d.ts +2 -24
- package/lib/index.js +1 -0
- package/lib/load/load-files.js +3 -1
- package/lib/middlewares/favicon.js +1 -1
- package/lib/middlewares/public/index.js +1 -1
- package/lib/services/entity-service/index.d.ts +7 -1
- package/lib/services/entity-service/index.js +11 -1
- package/lib/services/fs.js +1 -1
- package/lib/services/metrics/index.js +5 -1
- package/lib/services/metrics/sender.js +7 -0
- package/lib/services/server/middleware.js +1 -1
- package/lib/services/utils/upload-files.js +1 -1
- package/lib/types/core/attributes/base.d.ts +74 -0
- package/lib/types/core/attributes/biginteger.d.ts +22 -0
- package/lib/types/core/attributes/boolean.d.ts +20 -0
- package/lib/types/core/attributes/common.d.ts +42 -0
- package/lib/types/core/attributes/component.d.ts +41 -0
- package/lib/types/core/attributes/date-time.d.ts +22 -0
- package/lib/types/core/attributes/date.d.ts +22 -0
- package/lib/types/core/attributes/decimal.d.ts +22 -0
- package/lib/types/core/attributes/dynamic-zone.d.ts +29 -0
- package/lib/types/core/attributes/email.d.ts +24 -0
- package/lib/types/core/attributes/enumeration.d.ts +28 -0
- package/lib/types/core/attributes/float.d.ts +22 -0
- package/lib/types/core/attributes/index.d.ts +26 -0
- package/lib/types/core/attributes/integer.d.ts +22 -0
- package/lib/types/core/attributes/json.d.ts +14 -0
- package/lib/types/core/attributes/media.d.ts +36 -0
- package/lib/types/core/attributes/password.d.ts +22 -0
- package/lib/types/core/attributes/relation.d.ts +66 -0
- package/lib/types/core/attributes/richtext.d.ts +22 -0
- package/lib/types/core/attributes/string.d.ts +30 -0
- package/lib/types/core/attributes/text.d.ts +30 -0
- package/lib/types/core/attributes/time.d.ts +22 -0
- package/lib/types/core/attributes/timestamp.d.ts +22 -0
- package/lib/types/core/attributes/uid.d.ts +57 -0
- package/lib/types/core/attributes/utils.d.ts +99 -0
- package/lib/types/core/index.d.ts +3 -0
- package/lib/types/core/schemas/index.d.ts +126 -0
- package/lib/types/core/strapi/index.d.ts +370 -0
- package/lib/types/factories.d.ts +52 -0
- package/lib/types/index.d.ts +4 -0
- package/lib/types/utils.d.ts +95 -0
- package/lib/utils/get-dirs.js +24 -10
- package/lib/utils/import-default.js +10 -0
- package/lib/utils/index.js +2 -0
- package/lib/utils/lifecycles.js +15 -0
- package/lib/utils/update-notifier/index.js +1 -1
- package/package.json +19 -17
- package/lib/factories.d.ts +0 -48
package/lib/factories.d.ts
DELETED
|
@@ -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;
|