@ooneex/module 1.2.3 → 1.2.4
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/README.md +7 -12
- package/dist/index.d.ts +3 -5
- package/package.json +6 -7
package/README.md
CHANGED
|
@@ -16,8 +16,6 @@ Module system for organizing application features into cohesive units -- groups
|
|
|
16
16
|
|
|
17
17
|
✅ **Middleware Scoping** - Attach middleware to specific modules
|
|
18
18
|
|
|
19
|
-
✅ **Permission Support** - Optional per-module permission classes
|
|
20
|
-
|
|
21
19
|
✅ **Cron Jobs** - Optional cron job classes scoped to a module
|
|
22
20
|
|
|
23
21
|
✅ **Event Handling** - Optional pub/sub event classes per module
|
|
@@ -42,12 +40,14 @@ const UserModule: ModuleType = {
|
|
|
42
40
|
controllers: [UserCreateController, UserListController],
|
|
43
41
|
entities: [UserEntity],
|
|
44
42
|
middlewares: [AuthMiddleware],
|
|
43
|
+
cronJobs: [],
|
|
44
|
+
events: [],
|
|
45
45
|
};
|
|
46
46
|
|
|
47
47
|
export { UserModule };
|
|
48
48
|
```
|
|
49
49
|
|
|
50
|
-
###
|
|
50
|
+
### Full Example
|
|
51
51
|
|
|
52
52
|
```typescript
|
|
53
53
|
import type { ModuleType } from '@ooneex/module';
|
|
@@ -55,7 +55,6 @@ import type { ModuleType } from '@ooneex/module';
|
|
|
55
55
|
const OrderModule: ModuleType = {
|
|
56
56
|
controllers: [OrderCreateController, OrderListController],
|
|
57
57
|
entities: [OrderEntity, OrderItemEntity],
|
|
58
|
-
permissions: [OrderPermission],
|
|
59
58
|
middlewares: [OrderValidationMiddleware],
|
|
60
59
|
cronJobs: [OrderCleanupCron],
|
|
61
60
|
events: [OrderCreatedEvent, OrderShippedEvent],
|
|
@@ -72,19 +71,15 @@ const OrderModule: ModuleType = {
|
|
|
72
71
|
type ModuleType = {
|
|
73
72
|
controllers: ControllerClassType[];
|
|
74
73
|
entities: EntityClassType[];
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
events?: PubSubClassType[];
|
|
74
|
+
middlewares: MiddlewareClassType[];
|
|
75
|
+
cronJobs: CronClassType[];
|
|
76
|
+
events: PubSubClassType[];
|
|
79
77
|
};
|
|
80
78
|
```
|
|
81
79
|
|
|
82
|
-
**
|
|
80
|
+
**Fields:**
|
|
83
81
|
- `controllers` - Array of controller classes belonging to this module
|
|
84
82
|
- `entities` - Array of entity classes belonging to this module
|
|
85
|
-
|
|
86
|
-
**Optional fields:**
|
|
87
|
-
- `permissions` - Permission classes for access control
|
|
88
83
|
- `middlewares` - Middleware classes to apply to this module
|
|
89
84
|
- `cronJobs` - Cron job classes scoped to this module
|
|
90
85
|
- `events` - Pub/sub event classes for this module
|
package/dist/index.d.ts
CHANGED
|
@@ -2,14 +2,12 @@ import { ControllerClassType } from "@ooneex/controller";
|
|
|
2
2
|
import { CronClassType } from "@ooneex/cron";
|
|
3
3
|
import { EntityClassType } from "@ooneex/entity";
|
|
4
4
|
import { MiddlewareClassType } from "@ooneex/middleware";
|
|
5
|
-
import { PermissionClassType } from "@ooneex/permission";
|
|
6
5
|
import { PubSubClassType } from "@ooneex/pub-sub";
|
|
7
6
|
type ModuleType = {
|
|
8
7
|
controllers: ControllerClassType[];
|
|
9
8
|
entities: EntityClassType[];
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
events?: PubSubClassType[];
|
|
9
|
+
middlewares: MiddlewareClassType[];
|
|
10
|
+
cronJobs: CronClassType[];
|
|
11
|
+
events: PubSubClassType[];
|
|
14
12
|
};
|
|
15
13
|
export { ModuleType };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ooneex/module",
|
|
3
3
|
"description": "Module system for organizing application features into cohesive units — groups controllers, entities, services, and middleware by domain",
|
|
4
|
-
"version": "1.2.
|
|
4
|
+
"version": "1.2.4",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
7
7
|
"dist",
|
|
@@ -27,12 +27,11 @@
|
|
|
27
27
|
"npm:publish": "bun publish --tolerate-republish --force --production --access public"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@ooneex/middleware": "1.2.
|
|
31
|
-
"@ooneex/controller": "1.3.
|
|
32
|
-
"@ooneex/
|
|
33
|
-
"@ooneex/
|
|
34
|
-
"@ooneex/
|
|
35
|
-
"@ooneex/entity": "1.1.2"
|
|
30
|
+
"@ooneex/middleware": "1.2.5",
|
|
31
|
+
"@ooneex/controller": "1.3.3",
|
|
32
|
+
"@ooneex/pub-sub": "1.1.5",
|
|
33
|
+
"@ooneex/cron": "1.1.5",
|
|
34
|
+
"@ooneex/entity": "1.1.3"
|
|
36
35
|
},
|
|
37
36
|
"keywords": [
|
|
38
37
|
"bun",
|