fragment-ts 1.2.1 → 1.2.3
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/API.md +624 -64
- package/DOCS.md +738 -134
- package/README.md +477 -72
- package/SETUP.md +571 -48
- package/USAGE.md +525 -192
- package/dist/core/container/di-container.d.ts.map +1 -1
- package/dist/core/container/di-container.js +8 -7
- package/dist/core/container/di-container.js.map +1 -1
- package/dist/core/decorators/frontend.decorator.d.ts +9 -8
- package/dist/core/decorators/frontend.decorator.d.ts.map +1 -1
- package/dist/core/decorators/frontend.decorator.js +17 -10
- package/dist/core/decorators/frontend.decorator.js.map +1 -1
- package/dist/core/decorators/http.decorators.d.ts.map +1 -1
- package/dist/core/decorators/http.decorators.js +2 -1
- package/dist/core/decorators/http.decorators.js.map +1 -1
- package/dist/core/decorators/request-context.decorator.d.ts.map +1 -1
- package/dist/core/decorators/request-context.decorator.js +2 -1
- package/dist/core/decorators/request-context.decorator.js.map +1 -1
- package/dist/core/metadata/metadata-keys.d.ts +1 -1
- package/dist/core/metadata/metadata-keys.js +1 -1
- package/dist/core/metadata/metadata-keys.js.map +1 -1
- package/dist/core/metadata/metadata-storage.d.ts +1 -1
- package/dist/core/metadata/metadata-storage.d.ts.map +1 -1
- package/dist/core/metadata/metadata-storage.js.map +1 -1
- package/dist/core/scanner/component-scanner.d.ts.map +1 -1
- package/dist/core/scanner/component-scanner.js +4 -4
- package/dist/core/scanner/component-scanner.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -25
- package/dist/index.js.map +1 -1
- package/dist/integrations/ai/ai.module.d.ts.map +1 -1
- package/dist/integrations/ai/ai.module.js +4 -3
- package/dist/integrations/ai/ai.module.js.map +1 -1
- package/dist/integrations/frontend/frontend-module.d.ts +2 -4
- package/dist/integrations/frontend/frontend-module.d.ts.map +1 -1
- package/dist/integrations/frontend/frontend-module.js +1 -32
- package/dist/integrations/frontend/frontend-module.js.map +1 -1
- package/dist/integrations/frontend/frontend-registry.d.ts.map +1 -1
- package/dist/integrations/frontend/frontend-registry.js +31 -20
- package/dist/integrations/frontend/frontend-registry.js.map +1 -1
- package/dist/integrations/frontend/frontend-router.d.ts.map +1 -1
- package/dist/integrations/frontend/frontend-router.js +18 -9
- package/dist/integrations/frontend/frontend-router.js.map +1 -1
- package/dist/integrations/frontend/frontend.types.d.ts +7 -10
- package/dist/integrations/frontend/frontend.types.d.ts.map +1 -1
- package/dist/integrations/frontend/store-manager.d.ts.map +1 -1
- package/dist/integrations/frontend/store-manager.js +41 -5
- package/dist/integrations/frontend/store-manager.js.map +1 -1
- package/dist/integrations/jobs/cron.utils.d.ts.map +1 -1
- package/dist/integrations/jobs/cron.utils.js +2 -1
- package/dist/integrations/jobs/cron.utils.js.map +1 -1
- package/dist/integrations/jobs/job-registry.d.ts.map +1 -1
- package/dist/integrations/jobs/job-registry.js +4 -3
- package/dist/integrations/jobs/job-registry.js.map +1 -1
- package/dist/integrations/jobs/job-scheduler.d.ts.map +1 -1
- package/dist/integrations/jobs/job-scheduler.js +3 -2
- package/dist/integrations/jobs/job-scheduler.js.map +1 -1
- package/dist/integrations/jobs/queue/inline-queue.d.ts.map +1 -1
- package/dist/integrations/jobs/queue/inline-queue.js +2 -1
- package/dist/integrations/jobs/queue/inline-queue.js.map +1 -1
- package/dist/integrations/mail/mail-manager.d.ts.map +1 -1
- package/dist/integrations/mail/mail-manager.js +3 -2
- package/dist/integrations/mail/mail-manager.js.map +1 -1
- package/dist/integrations/mail/mail-registry.d.ts.map +1 -1
- package/dist/integrations/mail/mail-registry.js +5 -4
- package/dist/integrations/mail/mail-registry.js.map +1 -1
- package/dist/integrations/mail/mail-template-registry.d.ts.map +1 -1
- package/dist/integrations/mail/mail-template-registry.js +4 -3
- package/dist/integrations/mail/mail-template-registry.js.map +1 -1
- package/dist/integrations/mail/mail-transport-registry.d.ts.map +1 -1
- package/dist/integrations/mail/mail-transport-registry.js +2 -1
- package/dist/integrations/mail/mail-transport-registry.js.map +1 -1
- package/dist/integrations/mail/transports/unsupported.transport.d.ts.map +1 -1
- package/dist/integrations/mail/transports/unsupported.transport.js +2 -1
- package/dist/integrations/mail/transports/unsupported.transport.js.map +1 -1
- package/dist/integrations/notifications/notification-manager.d.ts.map +1 -1
- package/dist/integrations/notifications/notification-manager.js +3 -2
- package/dist/integrations/notifications/notification-manager.js.map +1 -1
- package/dist/integrations/notifications/notification-registry.d.ts.map +1 -1
- package/dist/integrations/notifications/notification-registry.js +4 -3
- package/dist/integrations/notifications/notification-registry.js.map +1 -1
- package/dist/integrations/notifications/notification.utils.d.ts.map +1 -1
- package/dist/integrations/notifications/notification.utils.js +2 -1
- package/dist/integrations/notifications/notification.utils.js.map +1 -1
- package/dist/integrations/typeorm/config/DatabaseConfigLoader.d.ts.map +1 -1
- package/dist/integrations/typeorm/config/DatabaseConfigLoader.js +3 -2
- package/dist/integrations/typeorm/config/DatabaseConfigLoader.js.map +1 -1
- package/dist/integrations/typeorm/config/builders/CloudDatabaseBuilders.d.ts.map +1 -1
- package/dist/integrations/typeorm/config/builders/CloudDatabaseBuilders.js +7 -6
- package/dist/integrations/typeorm/config/builders/CloudDatabaseBuilders.js.map +1 -1
- package/dist/integrations/typeorm/config/builders/MobileDatabaseBuilders.d.ts.map +1 -1
- package/dist/integrations/typeorm/config/builders/MobileDatabaseBuilders.js +4 -3
- package/dist/integrations/typeorm/config/builders/MobileDatabaseBuilders.js.map +1 -1
- package/dist/integrations/typeorm/typeorm-module.d.ts.map +1 -1
- package/dist/integrations/typeorm/typeorm-module.js +2 -1
- package/dist/integrations/typeorm/typeorm-module.js.map +1 -1
- package/dist/platform/cli/commands/base/command-registry.d.ts.map +1 -1
- package/dist/platform/cli/commands/base/command-registry.js +2 -1
- package/dist/platform/cli/commands/base/command-registry.js.map +1 -1
- package/dist/platform/cli/commands/build/build.utils.d.ts +3 -0
- package/dist/platform/cli/commands/build/build.utils.d.ts.map +1 -0
- package/dist/platform/cli/commands/build/build.utils.js +86 -0
- package/dist/platform/cli/commands/build/build.utils.js.map +1 -0
- package/dist/platform/cli/commands/build/command.d.ts +8 -0
- package/dist/platform/cli/commands/build/command.d.ts.map +1 -0
- package/dist/platform/cli/commands/build/command.js +102 -0
- package/dist/platform/cli/commands/build/command.js.map +1 -0
- package/dist/platform/cli/commands/lint/command.d.ts.map +1 -1
- package/dist/platform/cli/commands/lint/command.js +2 -1
- package/dist/platform/cli/commands/lint/command.js.map +1 -1
- package/dist/platform/cli/commands/make/command.d.ts.map +1 -1
- package/dist/platform/cli/commands/make/command.js +0 -1
- package/dist/platform/cli/commands/make/command.js.map +1 -1
- package/dist/platform/cli/commands/migrate/command.d.ts.map +1 -1
- package/dist/platform/cli/commands/migrate/command.js +2 -1
- package/dist/platform/cli/commands/migrate/command.js.map +1 -1
- package/dist/platform/cli/commands/migrate/migrate.utils.d.ts.map +1 -1
- package/dist/platform/cli/commands/migrate/migrate.utils.js +2 -1
- package/dist/platform/cli/commands/migrate/migrate.utils.js.map +1 -1
- package/dist/platform/cli/scaffold/generate/component-generator.d.ts +1 -2
- package/dist/platform/cli/scaffold/generate/component-generator.d.ts.map +1 -1
- package/dist/platform/cli/scaffold/generate/component-generator.js +8 -30
- package/dist/platform/cli/scaffold/generate/component-generator.js.map +1 -1
- package/dist/platform/cli/scaffold/init/init.scaffold.d.ts.map +1 -1
- package/dist/platform/cli/scaffold/init/init.scaffold.js +67 -30
- package/dist/platform/cli/scaffold/init/init.scaffold.js.map +1 -1
- package/dist/platform/cli/scaffold/init/prompts.js +25 -0
- package/dist/platform/cli/scaffold/init/prompts.js.map +1 -1
- package/dist/platform/cli/scaffold/init/types.d.ts +2 -1
- package/dist/platform/cli/scaffold/init/types.d.ts.map +1 -1
- package/dist/platform/testing/runner.d.ts.map +1 -1
- package/dist/platform/testing/runner.js +22 -21
- package/dist/platform/testing/runner.js.map +1 -1
- package/dist/platform/web/bootstrap/ComponentRegistrar.d.ts.map +1 -1
- package/dist/platform/web/bootstrap/ComponentRegistrar.js +0 -2
- package/dist/platform/web/bootstrap/ComponentRegistrar.js.map +1 -1
- package/dist/plugins/plugin-manager.d.ts.map +1 -1
- package/dist/plugins/plugin-manager.js +2 -1
- package/dist/plugins/plugin-manager.js.map +1 -1
- package/dist/plugins/plugin-registry.d.ts.map +1 -1
- package/dist/plugins/plugin-registry.js +8 -7
- package/dist/plugins/plugin-registry.js.map +1 -1
- package/dist/shared/config.utils.d.ts +10 -0
- package/dist/shared/config.utils.d.ts.map +1 -1
- package/dist/shared/config.utils.js.map +1 -1
- package/dist/shared/errors.d.ts +147 -0
- package/dist/shared/errors.d.ts.map +1 -1
- package/dist/shared/errors.js +299 -1
- package/dist/shared/errors.js.map +1 -1
- package/examples/blog-api/.env.example +14 -0
- package/examples/blog-api/.eslintignore +3 -0
- package/examples/blog-api/.eslintrc.json +25 -0
- package/examples/blog-api/.prettierrc +6 -0
- package/examples/blog-api/fragment.json +56 -0
- package/examples/blog-api/package-lock.json +7062 -0
- package/examples/blog-api/package.json +33 -0
- package/examples/blog-api/postcss.config.js +6 -0
- package/examples/blog-api/src/entities/user.entity.ts +19 -0
- package/examples/blog-api/src/frontend/styles/tailwind.css +3 -0
- package/examples/blog-api/src/main.ts +15 -0
- package/examples/blog-api/src/modules/app/components/header.component.ts +4 -0
- package/examples/blog-api/src/modules/app/controllers/app.controller.ts +18 -0
- package/examples/blog-api/src/modules/app/services/app.service.ts +8 -0
- package/examples/blog-api/src/modules/app/stores/home.store.ts +12 -0
- package/examples/blog-api/src/modules/app/templates/app.template.ts +8 -0
- package/examples/blog-api/src/modules/app/views/home.view.ts +9 -0
- package/examples/blog-api/src/modules/jobs/example.job.ts +9 -0
- package/examples/blog-api/src/modules/mail/primary.mail.ts +13 -0
- package/examples/blog-api/src/test/app.spec.ts +20 -0
- package/examples/blog-api/tailwind.config.js +8 -0
- package/examples/blog-api/tsconfig.json +24 -0
- package/package.json +12 -1
- package/src/core/container/di-container.ts +0 -488
- package/src/core/context/request-context.ts +0 -16
- package/src/core/decorators/DECORATOR_USAGE.md +0 -314
- package/src/core/decorators/api.decorator.ts +0 -97
- package/src/core/decorators/application.decorator.ts +0 -25
- package/src/core/decorators/auto-configuration.decorator.ts +0 -16
- package/src/core/decorators/conditional.decorators.ts +0 -19
- package/src/core/decorators/controller.decorator.ts +0 -17
- package/src/core/decorators/exception-filter.decorator.ts +0 -42
- package/src/core/decorators/frontend.decorator.ts +0 -199
- package/src/core/decorators/guard.decorator.ts +0 -42
- package/src/core/decorators/http.decorators.ts +0 -70
- package/src/core/decorators/injectable.decorator.ts +0 -17
- package/src/core/decorators/injection.decorators.ts +0 -180
- package/src/core/decorators/interceptor.decorator.ts +0 -45
- package/src/core/decorators/job.decorator.ts +0 -51
- package/src/core/decorators/lifecycle.decorator.ts +0 -41
- package/src/core/decorators/mail.decorator.ts +0 -103
- package/src/core/decorators/middleware.decorator.ts +0 -49
- package/src/core/decorators/notification.decorator.ts +0 -27
- package/src/core/decorators/plugin-lifecycle.decorator.ts +0 -45
- package/src/core/decorators/plugin.decorator.ts +0 -75
- package/src/core/decorators/repository.decorator.ts +0 -16
- package/src/core/decorators/request-context.decorator.ts +0 -20
- package/src/core/decorators/service.decorator.ts +0 -16
- package/src/core/index.ts +0 -21
- package/src/core/metadata/metadata-keys.ts +0 -82
- package/src/core/metadata/metadata-storage.ts +0 -266
- package/src/core/scanner/component-scanner.ts +0 -323
- package/src/core/types/decoration.types.ts +0 -40
- package/src/index.ts +0 -124
- package/src/integrations/ai/ai.module.ts +0 -110
- package/src/integrations/auth/auth.module.ts +0 -77
- package/src/integrations/docs/doc-generator.ts +0 -480
- package/src/integrations/docs/index.ts +0 -1
- package/src/integrations/frontend/frontend-module.ts +0 -217
- package/src/integrations/frontend/frontend-registry.ts +0 -275
- package/src/integrations/frontend/frontend-router.ts +0 -47
- package/src/integrations/frontend/frontend.types.ts +0 -85
- package/src/integrations/frontend/index.ts +0 -6
- package/src/integrations/frontend/store-manager.ts +0 -84
- package/src/integrations/frontend/theme-manager.ts +0 -25
- package/src/integrations/jobs/cron.utils.ts +0 -118
- package/src/integrations/jobs/index.ts +0 -8
- package/src/integrations/jobs/job-manager.ts +0 -32
- package/src/integrations/jobs/job-registry.ts +0 -107
- package/src/integrations/jobs/job-scheduler.ts +0 -219
- package/src/integrations/jobs/job.ts +0 -40
- package/src/integrations/jobs/job.types.ts +0 -42
- package/src/integrations/jobs/job.utils.ts +0 -12
- package/src/integrations/jobs/queue/inline-queue.ts +0 -16
- package/src/integrations/jobs/scheduled-job.ts +0 -34
- package/src/integrations/mail/configured-mail-provider.ts +0 -19
- package/src/integrations/mail/index.ts +0 -7
- package/src/integrations/mail/mail-manager.ts +0 -74
- package/src/integrations/mail/mail-registry.ts +0 -159
- package/src/integrations/mail/mail-template-registry.ts +0 -113
- package/src/integrations/mail/mail-transport-registry.ts +0 -29
- package/src/integrations/mail/mail.types.ts +0 -67
- package/src/integrations/mail/queue/inline-queue.ts +0 -14
- package/src/integrations/mail/transports/console.transport.ts +0 -22
- package/src/integrations/mail/transports/unsupported.transport.ts +0 -13
- package/src/integrations/notifications/channels/mail.channel.ts +0 -42
- package/src/integrations/notifications/index.ts +0 -6
- package/src/integrations/notifications/notification-channel.ts +0 -31
- package/src/integrations/notifications/notification-manager.ts +0 -66
- package/src/integrations/notifications/notification-registry.ts +0 -106
- package/src/integrations/notifications/notification.types.ts +0 -23
- package/src/integrations/notifications/notification.utils.ts +0 -52
- package/src/integrations/typeorm/config/DatabaseConfigLoader.ts +0 -205
- package/src/integrations/typeorm/config/builders/CloudDatabaseBuilders.ts +0 -117
- package/src/integrations/typeorm/config/builders/MobileDatabaseBuilders.ts +0 -148
- package/src/integrations/typeorm/config/builders/NoSQLDatabaseBuilders.ts +0 -17
- package/src/integrations/typeorm/config/builders/SQLDatabaseBuilders.ts +0 -189
- package/src/integrations/typeorm/config/index.ts +0 -0
- package/src/integrations/typeorm/typeorm-module.ts +0 -53
- package/src/integrations/typeorm/types/SupportedDatabaseConfig.ts +0 -42
- package/src/integrations/typeorm/types/SupportedDatabaseOptions.ts +0 -42
- package/src/platform/cli/commands/add/add.utils.ts +0 -37
- package/src/platform/cli/commands/add/command.ts +0 -29
- package/src/platform/cli/commands/base/command-registry.ts +0 -29
- package/src/platform/cli/commands/base/command-runner.ts +0 -22
- package/src/platform/cli/commands/base/fragment-command.ts +0 -52
- package/src/platform/cli/commands/cache/command.ts +0 -14
- package/src/platform/cli/commands/config/command.ts +0 -26
- package/src/platform/cli/commands/diagnostics/command.ts +0 -35
- package/src/platform/cli/commands/diagnostics/diagnostics.actions.ts +0 -415
- package/src/platform/cli/commands/docs/command.ts +0 -18
- package/src/platform/cli/commands/docs/docs.actions.ts +0 -50
- package/src/platform/cli/commands/env/command.ts +0 -195
- package/src/platform/cli/commands/env/env.utils.ts +0 -27
- package/src/platform/cli/commands/generate/command.ts +0 -48
- package/src/platform/cli/commands/init/command.ts +0 -122
- package/src/platform/cli/commands/lint/command.ts +0 -128
- package/src/platform/cli/commands/make/command.ts +0 -97
- package/src/platform/cli/commands/migrate/command.ts +0 -566
- package/src/platform/cli/commands/migrate/migrate.utils.ts +0 -75
- package/src/platform/cli/commands/plugin/command.ts +0 -59
- package/src/platform/cli/commands/plugin/plugin.actions.ts +0 -285
- package/src/platform/cli/commands/register.ts +0 -40
- package/src/platform/cli/commands/route/command.ts +0 -11
- package/src/platform/cli/commands/serve/command.ts +0 -118
- package/src/platform/cli/commands/serve/serve.utils.ts +0 -49
- package/src/platform/cli/commands/test/command.ts +0 -152
- package/src/platform/cli/commands/test/test.utils.ts +0 -100
- package/src/platform/cli/index.ts +0 -30
- package/src/platform/cli/scaffold/generate/component-generator.ts +0 -801
- package/src/platform/cli/scaffold/generate/validation.ts +0 -19
- package/src/platform/cli/scaffold/init/init.scaffold.ts +0 -1164
- package/src/platform/cli/scaffold/init/prompts.ts +0 -285
- package/src/platform/cli/scaffold/init/types.ts +0 -50
- package/src/platform/cli/scaffold/naming.ts +0 -37
- package/src/platform/testing/TEST.md +0 -381
- package/src/platform/testing/runner.ts +0 -419
- package/src/platform/web/application.ts +0 -26
- package/src/platform/web/bootstrap/ApplicationBootstrapper.ts +0 -314
- package/src/platform/web/bootstrap/ComponentRegistrar.ts +0 -153
- package/src/platform/web/bootstrap/ComponentScanner.ts +0 -30
- package/src/platform/web/bootstrap/RouteRegistrar.ts +0 -204
- package/src/platform/web/interfaces.ts +0 -26
- package/src/platform/web/middleware/ErrorHandler.ts +0 -55
- package/src/platform/web/middleware/MiddlewareSetup.ts +0 -25
- package/src/platform/web/middleware/RouteExecutor.ts +0 -133
- package/src/platform/web/utils/ConsoleLogger.ts +0 -37
- package/src/platform/web/utils/RouteUtils.ts +0 -27
- package/src/plugins/interface.ts +0 -10
- package/src/plugins/plugin-manager.ts +0 -50
- package/src/plugins/plugin-registry.ts +0 -311
- package/src/shared/config.utils.ts +0 -386
- package/src/shared/env.utils.ts +0 -50
- package/src/shared/errors.ts +0 -224
- package/src/shared/logger.ts +0 -143
- package/src/shared/runtime.resolver.ts +0 -192
- package/src/shared/tsconfig.utils.ts +0 -73
- package/tsconfig.json +0 -24
- package/working_momory/possible-updates.md +0 -98
package/API.md
CHANGED
|
@@ -1,25 +1,24 @@
|
|
|
1
1
|
# Fragment TS API Reference
|
|
2
2
|
|
|
3
3
|
This document lists public exports and their intended usage.
|
|
4
|
+
Each item is documented on its own line for easy search and indexing.
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
- `FragmentApplication(options)` class decorator
|
|
7
|
-
- `FragmentWebApplication` bootstrap class
|
|
8
|
-
- `DIContainer`
|
|
9
|
-
- `MetadataStorage`
|
|
10
|
-
- `ComponentScanner`
|
|
6
|
+
## Core Application
|
|
7
|
+
- `FragmentApplication(options)` class decorator
|
|
8
|
+
- `FragmentWebApplication` bootstrap class
|
|
9
|
+
- `DIContainer` dependency injection container
|
|
10
|
+
- `MetadataStorage` metadata registry
|
|
11
|
+
- `ComponentScanner` manual component scanning
|
|
11
12
|
|
|
12
|
-
|
|
13
|
+
## Core Decorators
|
|
14
|
+
- `@FragmentApplication(options)`
|
|
13
15
|
- `@Controller(path?)`
|
|
14
16
|
- `@Service()`
|
|
15
17
|
- `@FragmentRepository()`
|
|
16
18
|
- `@Injectable(scope?)`
|
|
17
19
|
- `@AutoConfiguration()`
|
|
18
|
-
- `@ConditionalOnClass(classRef)`
|
|
19
|
-
- `@ConditionalOnMissingBean(token)`
|
|
20
|
-
- `@ConditionalOnProperty(key, expectedValue?)`
|
|
21
20
|
|
|
22
|
-
|
|
21
|
+
## Injection Decorators
|
|
23
22
|
- `@Autowired()`
|
|
24
23
|
- `@Inject(token)`
|
|
25
24
|
- `@InjectRepository(entity)`
|
|
@@ -28,7 +27,7 @@ This document lists public exports and their intended usage.
|
|
|
28
27
|
- `@Optional()`
|
|
29
28
|
- `@Lazy()`
|
|
30
29
|
|
|
31
|
-
|
|
30
|
+
## HTTP Decorators
|
|
32
31
|
- `@Get(path?)`
|
|
33
32
|
- `@Post(path?)`
|
|
34
33
|
- `@Put(path?)`
|
|
@@ -41,99 +40,660 @@ This document lists public exports and their intended usage.
|
|
|
41
40
|
- `@Req()`
|
|
42
41
|
- `@Res()`
|
|
43
42
|
|
|
44
|
-
|
|
43
|
+
## Lifecycle Decorators
|
|
45
44
|
- `@PostConstruct()`
|
|
46
45
|
- `@PreDestroy()`
|
|
47
46
|
- `@OnStartup(order?)`
|
|
48
47
|
- `@OnShutdown(order?)`
|
|
49
48
|
|
|
50
|
-
|
|
49
|
+
## Pipeline Decorators
|
|
51
50
|
- `@FragmentMiddleware(MiddlewareClass)`
|
|
52
51
|
- `@FragmentGuard(GuardClass)`
|
|
53
52
|
- `@FragmentInterceptor(InterceptorClass)`
|
|
54
53
|
- `@FragmentExceptionFilter(ExceptionFilterClass)`
|
|
55
54
|
|
|
56
|
-
|
|
57
|
-
- `@
|
|
58
|
-
-
|
|
55
|
+
## Plugin Decorators
|
|
56
|
+
- `@Plugin(options)`
|
|
57
|
+
- `@Plugin(token, qualifier?) (property)`
|
|
58
|
+
- `@OnPluginInit(order?)`
|
|
59
|
+
- `@OnPluginShutdown(order?)`
|
|
59
60
|
|
|
60
|
-
|
|
61
|
-
- `@Plugin(options)` class decorator.
|
|
62
|
-
- `@Plugin(token, qualifier?)` property decorator.
|
|
63
|
-
- `@OnPluginInit(order?)` and `@OnPluginShutdown(order?)`.
|
|
64
|
-
- `PluginRegistry` and `PluginManager`.
|
|
65
|
-
|
|
66
|
-
**Mail**
|
|
61
|
+
## Mail Decorators
|
|
67
62
|
- `@Mailer(options)`
|
|
68
|
-
- `@Mail(qualifier?)
|
|
63
|
+
- `@Mail(qualifier?) (property)`
|
|
69
64
|
- `@MailTemplate(options)`
|
|
70
|
-
- `MailManager`
|
|
71
|
-
- `MailTemplateRegistry`
|
|
72
|
-
- `MailTransportRegistry`
|
|
73
|
-
- `MailProvider`, `MailMessage`, `MailTransport`, `MailQueueAdapter`
|
|
74
65
|
|
|
75
|
-
|
|
66
|
+
## Notification Decorators
|
|
76
67
|
- `@NotificationChannel(options)`
|
|
77
|
-
- `NotificationManager`
|
|
78
|
-
- `NotificationChannel`
|
|
79
|
-
- `Notification`, `MailNotification`, `NotificationChannelSelection`
|
|
80
68
|
|
|
81
|
-
|
|
69
|
+
## Jobs Decorators
|
|
82
70
|
- `@Job(options)`
|
|
83
71
|
- `@Cron(expression, options?)`
|
|
84
|
-
- `Job`
|
|
85
|
-
- `ScheduledJob`
|
|
86
|
-
- `JobManager`
|
|
87
|
-
- `JobScheduler`
|
|
88
|
-
- `JobQueueAdapter`, `JobContext`, `JobRunOptions`, `ScheduleOptions`
|
|
89
72
|
|
|
90
|
-
|
|
73
|
+
## Frontend Decorators
|
|
91
74
|
- `@View(options)`
|
|
92
|
-
- `@Views(options)`
|
|
93
|
-
- `@ViewModel(options)`
|
|
75
|
+
- `@Views(options)`
|
|
94
76
|
- `@Store(options)`
|
|
95
77
|
- `@UIComponent(options)`
|
|
78
|
+
- `@Template(options)`
|
|
79
|
+
- `@Templates(options)`
|
|
96
80
|
- `@Action(options)`
|
|
97
|
-
- `@Actions(options)`
|
|
81
|
+
- `@Actions(options)`
|
|
98
82
|
- `@Effect(options)`
|
|
99
|
-
- `@Effects(options)`
|
|
83
|
+
- `@Effects(options)`
|
|
84
|
+
- `@State(options?)`
|
|
85
|
+
- `@States(options?)`
|
|
86
|
+
|
|
87
|
+
## Docs Decorators
|
|
88
|
+
- `@ApiTag(tag)`
|
|
89
|
+
- `@ApiOperation({ summary, description })`
|
|
90
|
+
- `@ApiResponse({ status, description, type, isArray, example })`
|
|
91
|
+
- `@ApiProperty({ description, required, example, type })`
|
|
92
|
+
## Frontend Classes
|
|
100
93
|
- `FrontendModule`
|
|
101
94
|
- `FrontendRegistry`
|
|
102
95
|
- `FrontendRouter`
|
|
103
96
|
- `StoreManager`
|
|
104
97
|
- `ThemeManager`
|
|
105
|
-
- `
|
|
98
|
+
- `MobXStoreAdapter`
|
|
106
99
|
|
|
107
|
-
|
|
108
|
-
-
|
|
109
|
-
-
|
|
110
|
-
-
|
|
111
|
-
-
|
|
100
|
+
## Mail Classes
|
|
101
|
+
- `MailManager`
|
|
102
|
+
- `MailTemplateRegistry`
|
|
103
|
+
- `MailTransportRegistry`
|
|
104
|
+
- `ConfiguredMailProvider`
|
|
105
|
+
- `MailProvider`
|
|
106
|
+
- `MailMessage`
|
|
107
|
+
- `MailSendResult`
|
|
108
|
+
- `MailTransport`
|
|
109
|
+
- `MailQueueAdapter`
|
|
110
|
+
|
|
111
|
+
## Notification Classes
|
|
112
|
+
- `NotificationManager`
|
|
113
|
+
- `NotificationRegistry`
|
|
114
|
+
- `NotificationChannel`
|
|
115
|
+
- `MailNotificationChannel`
|
|
116
|
+
- `Notification`
|
|
117
|
+
- `MailNotification`
|
|
118
|
+
- `NotificationChannelSelection`
|
|
119
|
+
|
|
120
|
+
## Jobs Classes
|
|
121
|
+
- `Job`
|
|
122
|
+
- `ScheduledJob`
|
|
123
|
+
- `JobManager`
|
|
124
|
+
- `JobScheduler`
|
|
125
|
+
- `JobQueueAdapter`
|
|
126
|
+
- `JobContext`
|
|
127
|
+
- `JobRunOptions`
|
|
128
|
+
- `ScheduleOptions`
|
|
129
|
+
|
|
130
|
+
## Docs Classes
|
|
112
131
|
- `DocGenerator`
|
|
113
132
|
|
|
114
|
-
|
|
115
|
-
- `AuthModule`
|
|
116
|
-
- `authMiddleware()`
|
|
133
|
+
## Auth Module
|
|
134
|
+
- `AuthModule`
|
|
135
|
+
- `authMiddleware()`
|
|
136
|
+
- `roleGuard()`
|
|
117
137
|
|
|
118
|
-
|
|
119
|
-
- `AIModule`
|
|
120
|
-
-
|
|
138
|
+
## AI Module
|
|
139
|
+
- `AIModule`
|
|
140
|
+
- `AIProvider`
|
|
141
|
+
- `OpenAIProvider`
|
|
142
|
+
- `OllamaProvider`
|
|
121
143
|
|
|
122
|
-
|
|
123
|
-
- `FragmentError`
|
|
144
|
+
## Errors
|
|
145
|
+
- `FragmentError`
|
|
146
|
+
- `BadRequestError`
|
|
147
|
+
- `UnauthorizedError`
|
|
148
|
+
- `ForbiddenError`
|
|
149
|
+
- `NotFoundError`
|
|
150
|
+
- `ConflictError`
|
|
151
|
+
- `ValidationError`
|
|
152
|
+
- `InternalServerError`
|
|
124
153
|
|
|
125
|
-
|
|
126
|
-
- `FragmentLogger`
|
|
154
|
+
## Logging
|
|
155
|
+
- `FragmentLogger`
|
|
156
|
+
- `LoggerSettings`
|
|
157
|
+
- `LogLevel`
|
|
127
158
|
|
|
128
|
-
|
|
129
|
-
- `
|
|
159
|
+
## Testing
|
|
160
|
+
- `initTestRunner()`
|
|
161
|
+
- `describe()`
|
|
162
|
+
- `it()`
|
|
163
|
+
- `expect()`
|
|
164
|
+
- `beforeEach()`
|
|
165
|
+
- `afterEach()`
|
|
130
166
|
|
|
131
|
-
|
|
167
|
+
## CLI Programmatic API
|
|
132
168
|
- `FragmentCommand`
|
|
133
169
|
- `CommandRegistry`
|
|
134
170
|
- `CommandRunner`
|
|
135
171
|
|
|
136
|
-
|
|
172
|
+
## Request Context
|
|
173
|
+
- `RequestContextStorage`
|
|
174
|
+
- `@RequestContext()`
|
|
175
|
+
|
|
176
|
+
## Third-Party Re-exports
|
|
137
177
|
- `express` (from Express)
|
|
138
178
|
- `typeorm`
|
|
139
179
|
- `dotenv`
|
|
180
|
+
|
|
181
|
+
## CLI Commands
|
|
182
|
+
- `fragment init [dir]`
|
|
183
|
+
- `fragment init --type=plugin`
|
|
184
|
+
- `fragment serve`
|
|
185
|
+
- `fragment build`
|
|
186
|
+
- `fragment test`
|
|
187
|
+
- `fragment lint`
|
|
188
|
+
- `fragment route:list`
|
|
189
|
+
- `fragment config:cache`
|
|
190
|
+
- `fragment cache:clear`
|
|
191
|
+
- `fragment env:init`
|
|
192
|
+
- `fragment env:list`
|
|
193
|
+
- `fragment env:use <file>`
|
|
194
|
+
- `fragment env:diff [file]`
|
|
195
|
+
- `fragment doc:generate`
|
|
196
|
+
- `fragment plugin:list`
|
|
197
|
+
- `fragment plugin:info <name>`
|
|
198
|
+
- `fragment plugin:remove <name>`
|
|
199
|
+
- `fragment plugin:enable <name>`
|
|
200
|
+
- `fragment plugin:disable <name>`
|
|
201
|
+
- `fragment add <package>`
|
|
202
|
+
- `fragment make:controller <name>`
|
|
203
|
+
- `fragment make:service <name>`
|
|
204
|
+
- `fragment make:resource <name>`
|
|
205
|
+
- `fragment make:dto <name>`
|
|
206
|
+
- `fragment make:middleware <name>`
|
|
207
|
+
- `fragment make:guard <name>`
|
|
208
|
+
- `fragment make:job <name>`
|
|
209
|
+
- `fragment make:mail <name>`
|
|
210
|
+
- `fragment make:notification <name>`
|
|
211
|
+
- `fragment make:view <name>`
|
|
212
|
+
- `fragment make:store <name>`
|
|
213
|
+
- `fragment make:component <name>`
|
|
214
|
+
- `fragment make:template <name>`
|
|
215
|
+
## Configuration Keys
|
|
216
|
+
- `structure.type`
|
|
217
|
+
- `verbose`
|
|
218
|
+
- `logging.level`
|
|
219
|
+
- `logging.structured`
|
|
220
|
+
- `database.*`
|
|
221
|
+
- `database.entities`
|
|
222
|
+
- `database.migrations`
|
|
223
|
+
- `mail.default`
|
|
224
|
+
- `mail.mailers`
|
|
225
|
+
- `mail.templatesDir`
|
|
226
|
+
- `mail.queue.enabled`
|
|
227
|
+
- `notifications.defaultChannels`
|
|
228
|
+
- `jobs.enabled`
|
|
229
|
+
- `jobs.timezone`
|
|
230
|
+
- `docs.enabled`
|
|
231
|
+
- `docs.path`
|
|
232
|
+
- `docs.outputDir`
|
|
233
|
+
- `docs.template`
|
|
234
|
+
- `docs.perModule`
|
|
235
|
+
- `docs.perModuleRoutes`
|
|
236
|
+
- `plugins`
|
|
237
|
+
- `pluginAutoQualify`
|
|
238
|
+
- `frontend.enabled`
|
|
239
|
+
- `frontend.templates.default`
|
|
240
|
+
- `frontend.templates.system`
|
|
241
|
+
- `frontend.templates.custom`
|
|
242
|
+
- `frontend.styles.framework`
|
|
243
|
+
- `frontend.styles.tailwind`
|
|
244
|
+
- `frontend.routes.base`
|
|
245
|
+
|
|
246
|
+
## API Notes
|
|
247
|
+
- `@FragmentApplication(options)` is part of the public API surface.
|
|
248
|
+
- `@Controller(path?)` is part of the public API surface.
|
|
249
|
+
- `@Service()` is part of the public API surface.
|
|
250
|
+
- `@FragmentRepository()` is part of the public API surface.
|
|
251
|
+
- `@Injectable(scope?)` is part of the public API surface.
|
|
252
|
+
- `@AutoConfiguration()` is part of the public API surface.
|
|
253
|
+
- `@Autowired()` is part of the injection API surface.
|
|
254
|
+
- `@Inject(token)` is part of the injection API surface.
|
|
255
|
+
- `@InjectRepository(entity)` is part of the injection API surface.
|
|
256
|
+
- `@Value(expression)` is part of the injection API surface.
|
|
257
|
+
- `@Qualifier(name)` is part of the injection API surface.
|
|
258
|
+
- `@Optional()` is part of the injection API surface.
|
|
259
|
+
- `@Lazy()` is part of the injection API surface.
|
|
260
|
+
- `@Get(path?)` is part of the HTTP routing API surface.
|
|
261
|
+
- `@Post(path?)` is part of the HTTP routing API surface.
|
|
262
|
+
- `@Put(path?)` is part of the HTTP routing API surface.
|
|
263
|
+
- `@Delete(path?)` is part of the HTTP routing API surface.
|
|
264
|
+
- `@Patch(path?)` is part of the HTTP routing API surface.
|
|
265
|
+
- `@Body()` is part of the HTTP routing API surface.
|
|
266
|
+
- `@Param(name?)` is part of the HTTP routing API surface.
|
|
267
|
+
- `@Query(name?)` is part of the HTTP routing API surface.
|
|
268
|
+
- `@Header(name?)` is part of the HTTP routing API surface.
|
|
269
|
+
- `@Req()` is part of the HTTP routing API surface.
|
|
270
|
+
- `@Res()` is part of the HTTP routing API surface.
|
|
271
|
+
- `@PostConstruct()` is part of the lifecycle API surface.
|
|
272
|
+
- `@PreDestroy()` is part of the lifecycle API surface.
|
|
273
|
+
- `@OnStartup(order?)` is part of the lifecycle API surface.
|
|
274
|
+
- `@OnShutdown(order?)` is part of the lifecycle API surface.
|
|
275
|
+
- `@View(options)` is part of the frontend API surface.
|
|
276
|
+
- `@Views(options)` is part of the frontend API surface.
|
|
277
|
+
- `@Store(options)` is part of the frontend API surface.
|
|
278
|
+
- `@UIComponent(options)` is part of the frontend API surface.
|
|
279
|
+
- `@Template(options)` is part of the frontend API surface.
|
|
280
|
+
- `@Templates(options)` is part of the frontend API surface.
|
|
281
|
+
- `@Action(options)` is part of the frontend API surface.
|
|
282
|
+
- `@Actions(options)` is part of the frontend API surface.
|
|
283
|
+
- `@Effect(options)` is part of the frontend API surface.
|
|
284
|
+
- `@Effects(options)` is part of the frontend API surface.
|
|
285
|
+
- `@State(options?)` is part of the frontend API surface.
|
|
286
|
+
- `@States(options?)` is part of the frontend API surface.
|
|
287
|
+
- `@ApiTag(tag)` is part of the docs API surface.
|
|
288
|
+
- `@ApiOperation({ summary, description })` is part of the docs API surface.
|
|
289
|
+
- `@ApiResponse({ status, description, type, isArray, example })` is part of the docs API surface.
|
|
290
|
+
- `@ApiProperty({ description, required, example, type })` is part of the docs API surface.
|
|
291
|
+
## Extended API Index
|
|
292
|
+
- CLI: `fragment init [dir]` is supported by the framework binary.
|
|
293
|
+
- CLI: `fragment init --type=plugin` is supported by the framework binary.
|
|
294
|
+
- CLI: `fragment serve` is supported by the framework binary.
|
|
295
|
+
- CLI: `fragment build` is supported by the framework binary.
|
|
296
|
+
- CLI: `fragment test` is supported by the framework binary.
|
|
297
|
+
- CLI: `fragment lint` is supported by the framework binary.
|
|
298
|
+
- CLI: `fragment route:list` is supported by the framework binary.
|
|
299
|
+
- CLI: `fragment config:cache` is supported by the framework binary.
|
|
300
|
+
- CLI: `fragment cache:clear` is supported by the framework binary.
|
|
301
|
+
- CLI: `fragment env:init` is supported by the framework binary.
|
|
302
|
+
- CLI: `fragment env:list` is supported by the framework binary.
|
|
303
|
+
- CLI: `fragment env:use <file>` is supported by the framework binary.
|
|
304
|
+
- CLI: `fragment env:diff [file]` is supported by the framework binary.
|
|
305
|
+
- CLI: `fragment doc:generate` is supported by the framework binary.
|
|
306
|
+
- CLI: `fragment plugin:list` is supported by the framework binary.
|
|
307
|
+
- CLI: `fragment plugin:info <name>` is supported by the framework binary.
|
|
308
|
+
- CLI: `fragment plugin:remove <name>` is supported by the framework binary.
|
|
309
|
+
- CLI: `fragment plugin:enable <name>` is supported by the framework binary.
|
|
310
|
+
- CLI: `fragment plugin:disable <name>` is supported by the framework binary.
|
|
311
|
+
- CLI: `fragment add <package>` is supported by the framework binary.
|
|
312
|
+
- CLI: `fragment make:controller <name>` is supported by the framework binary.
|
|
313
|
+
- CLI: `fragment make:service <name>` is supported by the framework binary.
|
|
314
|
+
- CLI: `fragment make:resource <name>` is supported by the framework binary.
|
|
315
|
+
- CLI: `fragment make:dto <name>` is supported by the framework binary.
|
|
316
|
+
- CLI: `fragment make:middleware <name>` is supported by the framework binary.
|
|
317
|
+
- CLI: `fragment make:guard <name>` is supported by the framework binary.
|
|
318
|
+
- CLI: `fragment make:job <name>` is supported by the framework binary.
|
|
319
|
+
- CLI: `fragment make:mail <name>` is supported by the framework binary.
|
|
320
|
+
- CLI: `fragment make:notification <name>` is supported by the framework binary.
|
|
321
|
+
- CLI: `fragment make:view <name>` is supported by the framework binary.
|
|
322
|
+
- CLI: `fragment make:store <name>` is supported by the framework binary.
|
|
323
|
+
- CLI: `fragment make:component <name>` is supported by the framework binary.
|
|
324
|
+
- CLI: `fragment make:template <name>` is supported by the framework binary.
|
|
325
|
+
- Config: `structure.type` appears in the configuration schema.
|
|
326
|
+
- Config: `verbose` appears in the configuration schema.
|
|
327
|
+
- Config: `logging.level` appears in the configuration schema.
|
|
328
|
+
- Config: `logging.structured` appears in the configuration schema.
|
|
329
|
+
- Config: `database.*` appears in the configuration schema.
|
|
330
|
+
- Config: `database.entities` appears in the configuration schema.
|
|
331
|
+
- Config: `database.migrations` appears in the configuration schema.
|
|
332
|
+
- Config: `mail.default` appears in the configuration schema.
|
|
333
|
+
- Config: `mail.mailers` appears in the configuration schema.
|
|
334
|
+
- Config: `mail.templatesDir` appears in the configuration schema.
|
|
335
|
+
- Config: `mail.queue.enabled` appears in the configuration schema.
|
|
336
|
+
- Config: `notifications.defaultChannels` appears in the configuration schema.
|
|
337
|
+
- Config: `jobs.enabled` appears in the configuration schema.
|
|
338
|
+
- Config: `jobs.timezone` appears in the configuration schema.
|
|
339
|
+
- Config: `docs.enabled` appears in the configuration schema.
|
|
340
|
+
- Config: `docs.path` appears in the configuration schema.
|
|
341
|
+
- Config: `docs.outputDir` appears in the configuration schema.
|
|
342
|
+
- Config: `docs.template` appears in the configuration schema.
|
|
343
|
+
- Config: `docs.perModule` appears in the configuration schema.
|
|
344
|
+
- Config: `docs.perModuleRoutes` appears in the configuration schema.
|
|
345
|
+
- Config: `plugins` appears in the configuration schema.
|
|
346
|
+
- Config: `pluginAutoQualify` appears in the configuration schema.
|
|
347
|
+
- Config: `frontend.enabled` appears in the configuration schema.
|
|
348
|
+
- Config: `frontend.templates.default` appears in the configuration schema.
|
|
349
|
+
- Config: `frontend.templates.system` appears in the configuration schema.
|
|
350
|
+
- Config: `frontend.templates.custom` appears in the configuration schema.
|
|
351
|
+
- Config: `frontend.routes.base` appears in the configuration schema.
|
|
352
|
+
- Export note 1: Keep names aligned with file suffixes.
|
|
353
|
+
- Export note 2: Keep names aligned with file suffixes.
|
|
354
|
+
- Export note 3: Keep names aligned with file suffixes.
|
|
355
|
+
- Export note 4: Keep names aligned with file suffixes.
|
|
356
|
+
- Export note 5: Keep names aligned with file suffixes.
|
|
357
|
+
- Export note 6: Keep names aligned with file suffixes.
|
|
358
|
+
- Export note 7: Keep names aligned with file suffixes.
|
|
359
|
+
- Export note 8: Keep names aligned with file suffixes.
|
|
360
|
+
- Export note 9: Keep names aligned with file suffixes.
|
|
361
|
+
- Export note 10: Keep names aligned with file suffixes.
|
|
362
|
+
- Export note 11: Keep names aligned with file suffixes.
|
|
363
|
+
- Export note 12: Keep names aligned with file suffixes.
|
|
364
|
+
- Export note 13: Keep names aligned with file suffixes.
|
|
365
|
+
- Export note 14: Keep names aligned with file suffixes.
|
|
366
|
+
- Export note 15: Keep names aligned with file suffixes.
|
|
367
|
+
- Export note 16: Keep names aligned with file suffixes.
|
|
368
|
+
- Export note 17: Keep names aligned with file suffixes.
|
|
369
|
+
- Export note 18: Keep names aligned with file suffixes.
|
|
370
|
+
- Export note 19: Keep names aligned with file suffixes.
|
|
371
|
+
- Export note 20: Keep names aligned with file suffixes.
|
|
372
|
+
- Export note 21: Keep names aligned with file suffixes.
|
|
373
|
+
- Export note 22: Keep names aligned with file suffixes.
|
|
374
|
+
- Export note 23: Keep names aligned with file suffixes.
|
|
375
|
+
- Export note 24: Keep names aligned with file suffixes.
|
|
376
|
+
- Export note 25: Keep names aligned with file suffixes.
|
|
377
|
+
- Export note 26: Keep names aligned with file suffixes.
|
|
378
|
+
- Export note 27: Keep names aligned with file suffixes.
|
|
379
|
+
- Export note 28: Keep names aligned with file suffixes.
|
|
380
|
+
- Export note 29: Keep names aligned with file suffixes.
|
|
381
|
+
- Export note 30: Keep names aligned with file suffixes.
|
|
382
|
+
- Export note 31: Keep names aligned with file suffixes.
|
|
383
|
+
- Export note 32: Keep names aligned with file suffixes.
|
|
384
|
+
- Export note 33: Keep names aligned with file suffixes.
|
|
385
|
+
- Export note 34: Keep names aligned with file suffixes.
|
|
386
|
+
- Export note 35: Keep names aligned with file suffixes.
|
|
387
|
+
- Export note 36: Keep names aligned with file suffixes.
|
|
388
|
+
- Export note 37: Keep names aligned with file suffixes.
|
|
389
|
+
- Export note 38: Keep names aligned with file suffixes.
|
|
390
|
+
- Export note 39: Keep names aligned with file suffixes.
|
|
391
|
+
- Export note 40: Keep names aligned with file suffixes.
|
|
392
|
+
- Export note 41: Keep names aligned with file suffixes.
|
|
393
|
+
- Export note 42: Keep names aligned with file suffixes.
|
|
394
|
+
- Export note 43: Keep names aligned with file suffixes.
|
|
395
|
+
- Export note 44: Keep names aligned with file suffixes.
|
|
396
|
+
- Export note 45: Keep names aligned with file suffixes.
|
|
397
|
+
- Export note 46: Keep names aligned with file suffixes.
|
|
398
|
+
- Export note 47: Keep names aligned with file suffixes.
|
|
399
|
+
- Export note 48: Keep names aligned with file suffixes.
|
|
400
|
+
- Export note 49: Keep names aligned with file suffixes.
|
|
401
|
+
- Export note 50: Keep names aligned with file suffixes.
|
|
402
|
+
- Export note 51: Keep names aligned with file suffixes.
|
|
403
|
+
- Export note 52: Keep names aligned with file suffixes.
|
|
404
|
+
- Export note 53: Keep names aligned with file suffixes.
|
|
405
|
+
- Export note 54: Keep names aligned with file suffixes.
|
|
406
|
+
- Export note 55: Keep names aligned with file suffixes.
|
|
407
|
+
- Export note 56: Keep names aligned with file suffixes.
|
|
408
|
+
- Export note 57: Keep names aligned with file suffixes.
|
|
409
|
+
- Export note 58: Keep names aligned with file suffixes.
|
|
410
|
+
- Export note 59: Keep names aligned with file suffixes.
|
|
411
|
+
- Export note 60: Keep names aligned with file suffixes.
|
|
412
|
+
- Export note 61: Keep names aligned with file suffixes.
|
|
413
|
+
- Export note 62: Keep names aligned with file suffixes.
|
|
414
|
+
- Export note 63: Keep names aligned with file suffixes.
|
|
415
|
+
- Export note 64: Keep names aligned with file suffixes.
|
|
416
|
+
- Export note 65: Keep names aligned with file suffixes.
|
|
417
|
+
- Export note 66: Keep names aligned with file suffixes.
|
|
418
|
+
- Export note 67: Keep names aligned with file suffixes.
|
|
419
|
+
- Export note 68: Keep names aligned with file suffixes.
|
|
420
|
+
- Export note 69: Keep names aligned with file suffixes.
|
|
421
|
+
- Export note 70: Keep names aligned with file suffixes.
|
|
422
|
+
- Export note 71: Keep names aligned with file suffixes.
|
|
423
|
+
- Export note 72: Keep names aligned with file suffixes.
|
|
424
|
+
- Export note 73: Keep names aligned with file suffixes.
|
|
425
|
+
- Export note 74: Keep names aligned with file suffixes.
|
|
426
|
+
- Export note 75: Keep names aligned with file suffixes.
|
|
427
|
+
- Export note 76: Keep names aligned with file suffixes.
|
|
428
|
+
- Export note 77: Keep names aligned with file suffixes.
|
|
429
|
+
- Export note 78: Keep names aligned with file suffixes.
|
|
430
|
+
- Export note 79: Keep names aligned with file suffixes.
|
|
431
|
+
- Export note 80: Keep names aligned with file suffixes.
|
|
432
|
+
- Export note 81: Keep names aligned with file suffixes.
|
|
433
|
+
- Export note 82: Keep names aligned with file suffixes.
|
|
434
|
+
- Export note 83: Keep names aligned with file suffixes.
|
|
435
|
+
- Export note 84: Keep names aligned with file suffixes.
|
|
436
|
+
- Export note 85: Keep names aligned with file suffixes.
|
|
437
|
+
- Export note 86: Keep names aligned with file suffixes.
|
|
438
|
+
- Export note 87: Keep names aligned with file suffixes.
|
|
439
|
+
- Export note 88: Keep names aligned with file suffixes.
|
|
440
|
+
- Export note 89: Keep names aligned with file suffixes.
|
|
441
|
+
- Export note 90: Keep names aligned with file suffixes.
|
|
442
|
+
- Export note 91: Keep names aligned with file suffixes.
|
|
443
|
+
- Export note 92: Keep names aligned with file suffixes.
|
|
444
|
+
- Export note 93: Keep names aligned with file suffixes.
|
|
445
|
+
- Export note 94: Keep names aligned with file suffixes.
|
|
446
|
+
- Export note 95: Keep names aligned with file suffixes.
|
|
447
|
+
- Export note 96: Keep names aligned with file suffixes.
|
|
448
|
+
- Export note 97: Keep names aligned with file suffixes.
|
|
449
|
+
- Export note 98: Keep names aligned with file suffixes.
|
|
450
|
+
- Export note 99: Keep names aligned with file suffixes.
|
|
451
|
+
- Export note 100: Keep names aligned with file suffixes.
|
|
452
|
+
- Export note 101: Keep names aligned with file suffixes.
|
|
453
|
+
- Export note 102: Keep names aligned with file suffixes.
|
|
454
|
+
- Export note 103: Keep names aligned with file suffixes.
|
|
455
|
+
- Export note 104: Keep names aligned with file suffixes.
|
|
456
|
+
- Export note 105: Keep names aligned with file suffixes.
|
|
457
|
+
- Export note 106: Keep names aligned with file suffixes.
|
|
458
|
+
- Export note 107: Keep names aligned with file suffixes.
|
|
459
|
+
- Export note 108: Keep names aligned with file suffixes.
|
|
460
|
+
- Export note 109: Keep names aligned with file suffixes.
|
|
461
|
+
- Export note 110: Keep names aligned with file suffixes.
|
|
462
|
+
- Export note 111: Keep names aligned with file suffixes.
|
|
463
|
+
- Export note 112: Keep names aligned with file suffixes.
|
|
464
|
+
- Export note 113: Keep names aligned with file suffixes.
|
|
465
|
+
- Export note 114: Keep names aligned with file suffixes.
|
|
466
|
+
- Export note 115: Keep names aligned with file suffixes.
|
|
467
|
+
- Export note 116: Keep names aligned with file suffixes.
|
|
468
|
+
- Export note 117: Keep names aligned with file suffixes.
|
|
469
|
+
- Export note 118: Keep names aligned with file suffixes.
|
|
470
|
+
- Export note 119: Keep names aligned with file suffixes.
|
|
471
|
+
- Export note 120: Keep names aligned with file suffixes.
|
|
472
|
+
|
|
473
|
+
## API Conventions
|
|
474
|
+
- API convention 1: Keep decorator usage near the class or method definition.
|
|
475
|
+
- API convention 2: Keep decorator usage near the class or method definition.
|
|
476
|
+
- API convention 3: Keep decorator usage near the class or method definition.
|
|
477
|
+
- API convention 4: Keep decorator usage near the class or method definition.
|
|
478
|
+
- API convention 5: Keep decorator usage near the class or method definition.
|
|
479
|
+
- API convention 6: Keep decorator usage near the class or method definition.
|
|
480
|
+
- API convention 7: Keep decorator usage near the class or method definition.
|
|
481
|
+
- API convention 8: Keep decorator usage near the class or method definition.
|
|
482
|
+
- API convention 9: Keep decorator usage near the class or method definition.
|
|
483
|
+
- API convention 10: Keep decorator usage near the class or method definition.
|
|
484
|
+
- API convention 11: Keep decorator usage near the class or method definition.
|
|
485
|
+
- API convention 12: Keep decorator usage near the class or method definition.
|
|
486
|
+
- API convention 13: Keep decorator usage near the class or method definition.
|
|
487
|
+
- API convention 14: Keep decorator usage near the class or method definition.
|
|
488
|
+
- API convention 15: Keep decorator usage near the class or method definition.
|
|
489
|
+
- API convention 16: Keep decorator usage near the class or method definition.
|
|
490
|
+
- API convention 17: Keep decorator usage near the class or method definition.
|
|
491
|
+
- API convention 18: Keep decorator usage near the class or method definition.
|
|
492
|
+
- API convention 19: Keep decorator usage near the class or method definition.
|
|
493
|
+
- API convention 20: Keep decorator usage near the class or method definition.
|
|
494
|
+
- API convention 21: Keep decorator usage near the class or method definition.
|
|
495
|
+
- API convention 22: Keep decorator usage near the class or method definition.
|
|
496
|
+
- API convention 23: Keep decorator usage near the class or method definition.
|
|
497
|
+
- API convention 24: Keep decorator usage near the class or method definition.
|
|
498
|
+
- API convention 25: Keep decorator usage near the class or method definition.
|
|
499
|
+
- API convention 26: Keep decorator usage near the class or method definition.
|
|
500
|
+
- API convention 27: Keep decorator usage near the class or method definition.
|
|
501
|
+
- API convention 28: Keep decorator usage near the class or method definition.
|
|
502
|
+
- API convention 29: Keep decorator usage near the class or method definition.
|
|
503
|
+
- API convention 30: Keep decorator usage near the class or method definition.
|
|
504
|
+
- API convention 31: Keep decorator usage near the class or method definition.
|
|
505
|
+
- API convention 32: Keep decorator usage near the class or method definition.
|
|
506
|
+
- API convention 33: Keep decorator usage near the class or method definition.
|
|
507
|
+
- API convention 34: Keep decorator usage near the class or method definition.
|
|
508
|
+
- API convention 35: Keep decorator usage near the class or method definition.
|
|
509
|
+
- API convention 36: Keep decorator usage near the class or method definition.
|
|
510
|
+
- API convention 37: Keep decorator usage near the class or method definition.
|
|
511
|
+
- API convention 38: Keep decorator usage near the class or method definition.
|
|
512
|
+
- API convention 39: Keep decorator usage near the class or method definition.
|
|
513
|
+
- API convention 40: Keep decorator usage near the class or method definition.
|
|
514
|
+
- API convention 41: Keep decorator usage near the class or method definition.
|
|
515
|
+
- API convention 42: Keep decorator usage near the class or method definition.
|
|
516
|
+
- API convention 43: Keep decorator usage near the class or method definition.
|
|
517
|
+
- API convention 44: Keep decorator usage near the class or method definition.
|
|
518
|
+
- API convention 45: Keep decorator usage near the class or method definition.
|
|
519
|
+
- API convention 46: Keep decorator usage near the class or method definition.
|
|
520
|
+
- API convention 47: Keep decorator usage near the class or method definition.
|
|
521
|
+
- API convention 48: Keep decorator usage near the class or method definition.
|
|
522
|
+
- API convention 49: Keep decorator usage near the class or method definition.
|
|
523
|
+
- API convention 50: Keep decorator usage near the class or method definition.
|
|
524
|
+
|
|
525
|
+
## API Walkthrough Examples
|
|
526
|
+
This section gives short, implementation-oriented examples for the most-used APIs.
|
|
527
|
+
|
|
528
|
+
### Application Bootstrapping
|
|
529
|
+
```ts
|
|
530
|
+
import { FragmentApplication, FragmentWebApplication } from "fragment-ts";
|
|
531
|
+
|
|
532
|
+
@FragmentApplication({ port: 3000, autoScan: true })
|
|
533
|
+
class App {}
|
|
534
|
+
|
|
535
|
+
async function bootstrap() {
|
|
536
|
+
const app = new FragmentWebApplication();
|
|
537
|
+
await app.bootstrap(App);
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
bootstrap();
|
|
541
|
+
```
|
|
542
|
+
|
|
543
|
+
### DI and Services
|
|
544
|
+
```ts
|
|
545
|
+
import { Service, Inject } from "fragment-ts";
|
|
546
|
+
|
|
547
|
+
@Service()
|
|
548
|
+
class TokenService {
|
|
549
|
+
generate() {
|
|
550
|
+
return "t_" + Date.now();
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
@Service()
|
|
555
|
+
class SessionService {
|
|
556
|
+
@Inject(TokenService)
|
|
557
|
+
private tokens!: TokenService;
|
|
558
|
+
|
|
559
|
+
create() {
|
|
560
|
+
return this.tokens.generate();
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
```
|
|
564
|
+
|
|
565
|
+
### FragmentError Usage
|
|
566
|
+
```ts
|
|
567
|
+
import { FragmentError } from "fragment-ts";
|
|
568
|
+
|
|
569
|
+
class PolicyError extends FragmentError {
|
|
570
|
+
constructor(message: string) {
|
|
571
|
+
super(message, 400, { policy: "signup" });
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
```
|
|
575
|
+
|
|
576
|
+
### HTTP Controllers
|
|
577
|
+
```ts
|
|
578
|
+
import { Controller, Get, Post, Body } from "fragment-ts";
|
|
579
|
+
|
|
580
|
+
@Controller("/tasks")
|
|
581
|
+
class TaskController {
|
|
582
|
+
@Get()
|
|
583
|
+
list() {
|
|
584
|
+
return [];
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
@Post()
|
|
588
|
+
create(@Body() body: any) {
|
|
589
|
+
return { id: "t_1", ...body };
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
```
|
|
593
|
+
|
|
594
|
+
### Plugin Lifecycle
|
|
595
|
+
```ts
|
|
596
|
+
import { Plugin, OnPluginInit, OnPluginShutdown } from "fragment-ts";
|
|
597
|
+
|
|
598
|
+
@Plugin({ name: "AuditPlugin" })
|
|
599
|
+
class AuditPlugin {
|
|
600
|
+
@OnPluginInit()
|
|
601
|
+
async init() {}
|
|
602
|
+
|
|
603
|
+
@OnPluginShutdown()
|
|
604
|
+
async shutdown() {}
|
|
605
|
+
}
|
|
606
|
+
```
|
|
607
|
+
|
|
608
|
+
### Mail and Templates
|
|
609
|
+
```ts
|
|
610
|
+
import { Mailer, MailTemplate, MailManager } from "fragment-ts";
|
|
611
|
+
import type { MailProvider, MailMessage } from "fragment-ts";
|
|
612
|
+
|
|
613
|
+
@Mailer({ name: "primary" })
|
|
614
|
+
class ConsoleMailer implements MailProvider {
|
|
615
|
+
async send(message: MailMessage) {
|
|
616
|
+
return { id: "mail_1", accepted: [String(message.to)], rejected: [] };
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
@MailTemplate({ name: "welcome", html: "<h1>Hello <%= name %></h1>" })
|
|
621
|
+
class WelcomeTemplate {}
|
|
622
|
+
|
|
623
|
+
const mail = new MailManager();
|
|
624
|
+
await mail.send({ to: "user@example.com", template: "welcome", data: { name: "Ada" } });
|
|
625
|
+
```
|
|
626
|
+
|
|
627
|
+
### Notifications
|
|
628
|
+
```ts
|
|
629
|
+
import { NotificationManager, NotificationChannel } from "fragment-ts";
|
|
630
|
+
|
|
631
|
+
@NotificationChannel({ name: "sms" })
|
|
632
|
+
class SmsChannel extends NotificationChannel<string> {
|
|
633
|
+
name = "sms";
|
|
634
|
+
protected async send(payload: string) {}
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
class AlertNotification {
|
|
638
|
+
via() { return ["sms"]; }
|
|
639
|
+
toSms() { return "Service degraded"; }
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
const manager = new NotificationManager();
|
|
643
|
+
await manager.send(new AlertNotification());
|
|
644
|
+
```
|
|
645
|
+
|
|
646
|
+
### Jobs and Scheduling
|
|
647
|
+
```ts
|
|
648
|
+
import { Job, Cron, ScheduledJob } from "fragment-ts";
|
|
649
|
+
|
|
650
|
+
@Job({ name: "metrics" })
|
|
651
|
+
class MetricsJob extends ScheduledJob {
|
|
652
|
+
async handle() {}
|
|
653
|
+
|
|
654
|
+
@Cron("0 * * * *")
|
|
655
|
+
async hourly() {}
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
new MetricsJob().everyHour(6);
|
|
659
|
+
```
|
|
660
|
+
|
|
661
|
+
### Frontend Metadata
|
|
662
|
+
```ts
|
|
663
|
+
import { View, Store, Template, UIComponent, State, Action } from "fragment-ts";
|
|
664
|
+
|
|
665
|
+
@Template({ name: "app", kind: "system", components: ["TopNav"] })
|
|
666
|
+
class AppTemplate {}
|
|
667
|
+
|
|
668
|
+
@UIComponent({ name: "TopNav" })
|
|
669
|
+
class TopNav {}
|
|
670
|
+
|
|
671
|
+
@Store({ name: "home" })
|
|
672
|
+
class HomeStore {
|
|
673
|
+
@State()
|
|
674
|
+
count = 0;
|
|
675
|
+
|
|
676
|
+
@Action()
|
|
677
|
+
increment() {
|
|
678
|
+
this.count += 1;
|
|
679
|
+
}
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
@View({ path: "/", template: "app", store: "home" })
|
|
683
|
+
class HomeView {}
|
|
684
|
+
```
|
|
685
|
+
|
|
686
|
+
### Docs Generation
|
|
687
|
+
```ts
|
|
688
|
+
import { DocGenerator } from "fragment-ts";
|
|
689
|
+
|
|
690
|
+
const generator = new DocGenerator();
|
|
691
|
+
generator.generate({ outputDir: "docs", perModule: true });
|
|
692
|
+
```
|
|
693
|
+
|
|
694
|
+
### Programmatic CLI
|
|
695
|
+
```ts
|
|
696
|
+
import { CommandRunner } from "fragment-ts";
|
|
697
|
+
|
|
698
|
+
await CommandRunner.run("route:list");
|
|
699
|
+
```
|