mongodb-dynamic-api 3.1.0 → 3.2.1
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/CHANGELOG.md +46 -0
- package/package.json +10 -10
- package/src/decorators/api-endpoint-visibility.decorator.js +1 -2
- package/src/decorators/api-endpoint-visibility.decorator.js.map +1 -1
- package/src/decorators/schema-options.decorator.js +2 -2
- package/src/decorators/schema-options.decorator.js.map +1 -1
- package/src/decorators/validator-pipe.decorator.js +1 -2
- package/src/decorators/validator-pipe.decorator.js.map +1 -1
- package/src/dynamic-api.module.d.ts +1 -1
- package/src/dynamic-api.module.js +11 -3
- package/src/dynamic-api.module.js.map +1 -1
- package/src/gateways/dynamic-api-broadcast.gateway.d.ts +11 -0
- package/src/gateways/dynamic-api-broadcast.gateway.js +40 -0
- package/src/gateways/dynamic-api-broadcast.gateway.js.map +1 -0
- package/src/gateways/index.d.ts +1 -0
- package/src/gateways/index.js +1 -0
- package/src/gateways/index.js.map +1 -1
- package/src/guards/base-policies.guard.d.ts +0 -25
- package/src/helpers/controller-ability-predicates.helper.js +1 -2
- package/src/helpers/controller-ability-predicates.helper.js.map +1 -1
- package/src/helpers/format.helper.js +6 -7
- package/src/helpers/format.helper.js.map +1 -1
- package/src/helpers/mixin-data.helper.d.ts +1 -1
- package/src/helpers/mixin-data.helper.js +3 -3
- package/src/helpers/mixin-data.helper.js.map +1 -1
- package/src/helpers/repository.helper.d.ts +0 -25
- package/src/helpers/repository.helper.js.map +1 -1
- package/src/helpers/route-decorators.helper.d.ts +1 -1
- package/src/helpers/route-decorators.helper.js +1 -2
- package/src/helpers/route-decorators.helper.js.map +1 -1
- package/src/helpers/route-description.helper.js +1 -2
- package/src/helpers/route-description.helper.js.map +1 -1
- package/src/helpers/schema.helper.d.ts +0 -25
- package/src/helpers/schema.helper.js +1 -2
- package/src/helpers/schema.helper.js.map +1 -1
- package/src/helpers/socket-config.helper.js +2 -3
- package/src/helpers/socket-config.helper.js.map +1 -1
- package/src/helpers/swagger-config.helper.js +1 -2
- package/src/helpers/swagger-config.helper.js.map +1 -1
- package/src/helpers/validation-config.helper.js +1 -2
- package/src/helpers/validation-config.helper.js.map +1 -1
- package/src/helpers/versioning-config.helper.js +2 -3
- package/src/helpers/versioning-config.helper.js.map +1 -1
- package/src/interfaces/dynamic-api-global-state.interface.d.ts +1 -25
- package/src/interfaces/dynamic-api-options.interface.d.ts +2 -0
- package/src/interfaces/dynamic-api-options.interface.js.map +1 -1
- package/src/interfaces/dynamic-api-policy-handler.interface.d.ts +0 -25
- package/src/interfaces/dynamic-api-schema-options.interface.d.ts +0 -25
- package/src/interfaces/dynamic-api-service-callback.interface.d.ts +0 -25
- package/src/mixins/entity-body.mixin.js +2 -2
- package/src/mixins/entity-body.mixin.js.map +1 -1
- package/src/mixins/entity-presenter.mixin.js +1 -2
- package/src/mixins/entity-presenter.mixin.js.map +1 -1
- package/src/mixins/policies-guard.mixin.js +2 -3
- package/src/mixins/policies-guard.mixin.js.map +1 -1
- package/src/models/base-entity.model.d.ts +0 -25
- package/src/modules/auth/auth.helper.d.ts +7 -5
- package/src/modules/auth/auth.helper.js +15 -14
- package/src/modules/auth/auth.helper.js.map +1 -1
- package/src/modules/auth/auth.module.d.ts +1 -1
- package/src/modules/auth/auth.module.js +10 -6
- package/src/modules/auth/auth.module.js.map +1 -1
- package/src/modules/auth/interfaces/auth-options.interface.d.ts +6 -1
- package/src/modules/auth/mixins/auth-controller.mixin.d.ts +2 -2
- package/src/modules/auth/mixins/auth-controller.mixin.js +3 -3
- package/src/modules/auth/mixins/auth-controller.mixin.js.map +1 -1
- package/src/modules/auth/mixins/auth-gateway.mixin.d.ts +2 -2
- package/src/modules/auth/mixins/auth-gateway.mixin.js +3 -3
- package/src/modules/auth/mixins/auth-gateway.mixin.js.map +1 -1
- package/src/modules/auth/mixins/auth-policies-guard.mixin.js +2 -3
- package/src/modules/auth/mixins/auth-policies-guard.mixin.js.map +1 -1
- package/src/modules/auth/services/base-auth.service.d.ts +1 -25
- package/src/modules/auth/services/base-auth.service.js +4 -0
- package/src/modules/auth/services/base-auth.service.js.map +1 -1
- package/src/routes/aggregate/aggregate-controller.mixin.js +1 -2
- package/src/routes/aggregate/aggregate-controller.mixin.js.map +1 -1
- package/src/routes/aggregate/aggregate-gateway.mixin.js +1 -2
- package/src/routes/aggregate/aggregate-gateway.mixin.js.map +1 -1
- package/src/routes/aggregate/aggregate-presenter.mixin.js +1 -2
- package/src/routes/aggregate/aggregate-presenter.mixin.js.map +1 -1
- package/src/routes/aggregate/aggregate.helper.js +3 -4
- package/src/routes/aggregate/aggregate.helper.js.map +1 -1
- package/src/routes/aggregate/aggregate.module.js +1 -1
- package/src/routes/aggregate/aggregate.module.js.map +1 -1
- package/src/routes/aggregate/base-aggregate.service.d.ts +0 -25
- package/src/routes/create-many/base-create-many.service.d.ts +0 -25
- package/src/routes/create-many/create-many-body.mixin.js +1 -2
- package/src/routes/create-many/create-many-body.mixin.js.map +1 -1
- package/src/routes/create-many/create-many-controller.interface.d.ts +2 -1
- package/src/routes/create-many/create-many-controller.mixin.d.ts +1 -1
- package/src/routes/create-many/create-many-controller.mixin.js +15 -8
- package/src/routes/create-many/create-many-controller.mixin.js.map +1 -1
- package/src/routes/create-many/create-many-gateway.mixin.js +1 -2
- package/src/routes/create-many/create-many-gateway.mixin.js.map +1 -1
- package/src/routes/create-many/create-many-presenter.mixin.js +1 -2
- package/src/routes/create-many/create-many-presenter.mixin.js.map +1 -1
- package/src/routes/create-many/create-many.helper.js +10 -7
- package/src/routes/create-many/create-many.helper.js.map +1 -1
- package/src/routes/create-many/create-many.module.js +4 -1
- package/src/routes/create-many/create-many.module.js.map +1 -1
- package/src/routes/create-one/base-create-one.service.d.ts +0 -25
- package/src/routes/create-one/create-one-controller.interface.d.ts +2 -1
- package/src/routes/create-one/create-one-controller.mixin.d.ts +1 -1
- package/src/routes/create-one/create-one-controller.mixin.js +15 -8
- package/src/routes/create-one/create-one-controller.mixin.js.map +1 -1
- package/src/routes/create-one/create-one-gateway.mixin.js +1 -2
- package/src/routes/create-one/create-one-gateway.mixin.js.map +1 -1
- package/src/routes/create-one/create-one.helper.js +10 -7
- package/src/routes/create-one/create-one.helper.js.map +1 -1
- package/src/routes/create-one/create-one.module.js +4 -1
- package/src/routes/create-one/create-one.module.js.map +1 -1
- package/src/routes/delete-many/base-delete-many.service.d.ts +0 -25
- package/src/routes/delete-many/delete-many-controller.interface.d.ts +2 -1
- package/src/routes/delete-many/delete-many-controller.mixin.d.ts +1 -1
- package/src/routes/delete-many/delete-many-controller.mixin.js +15 -8
- package/src/routes/delete-many/delete-many-controller.mixin.js.map +1 -1
- package/src/routes/delete-many/delete-many-gateway.mixin.js +1 -2
- package/src/routes/delete-many/delete-many-gateway.mixin.js.map +1 -1
- package/src/routes/delete-many/delete-many.helper.js +10 -7
- package/src/routes/delete-many/delete-many.helper.js.map +1 -1
- package/src/routes/delete-many/delete-many.module.js +4 -1
- package/src/routes/delete-many/delete-many.module.js.map +1 -1
- package/src/routes/delete-one/base-delete-one.service.d.ts +0 -25
- package/src/routes/delete-one/delete-one-controller.interface.d.ts +2 -1
- package/src/routes/delete-one/delete-one-controller.mixin.d.ts +1 -1
- package/src/routes/delete-one/delete-one-controller.mixin.js +15 -8
- package/src/routes/delete-one/delete-one-controller.mixin.js.map +1 -1
- package/src/routes/delete-one/delete-one-gateway.mixin.js +1 -2
- package/src/routes/delete-one/delete-one-gateway.mixin.js.map +1 -1
- package/src/routes/delete-one/delete-one.helper.js +10 -7
- package/src/routes/delete-one/delete-one.helper.js.map +1 -1
- package/src/routes/delete-one/delete-one.module.js +4 -1
- package/src/routes/delete-one/delete-one.module.js.map +1 -1
- package/src/routes/duplicate-many/base-duplicate-many.service.d.ts +0 -25
- package/src/routes/duplicate-many/duplicate-many-controller.interface.d.ts +2 -1
- package/src/routes/duplicate-many/duplicate-many-controller.mixin.d.ts +1 -1
- package/src/routes/duplicate-many/duplicate-many-controller.mixin.js +15 -8
- package/src/routes/duplicate-many/duplicate-many-controller.mixin.js.map +1 -1
- package/src/routes/duplicate-many/duplicate-many-gateway.mixin.js +1 -2
- package/src/routes/duplicate-many/duplicate-many-gateway.mixin.js.map +1 -1
- package/src/routes/duplicate-many/duplicate-many.helper.js +10 -7
- package/src/routes/duplicate-many/duplicate-many.helper.js.map +1 -1
- package/src/routes/duplicate-many/duplicate-many.module.js +4 -1
- package/src/routes/duplicate-many/duplicate-many.module.js.map +1 -1
- package/src/routes/duplicate-one/base-duplicate-one.service.d.ts +0 -25
- package/src/routes/duplicate-one/duplicate-one-controller.interface.d.ts +2 -1
- package/src/routes/duplicate-one/duplicate-one-controller.mixin.d.ts +1 -1
- package/src/routes/duplicate-one/duplicate-one-controller.mixin.js +15 -8
- package/src/routes/duplicate-one/duplicate-one-controller.mixin.js.map +1 -1
- package/src/routes/duplicate-one/duplicate-one-gateway.mixin.js +1 -2
- package/src/routes/duplicate-one/duplicate-one-gateway.mixin.js.map +1 -1
- package/src/routes/duplicate-one/duplicate-one.helper.js +10 -7
- package/src/routes/duplicate-one/duplicate-one.helper.js.map +1 -1
- package/src/routes/duplicate-one/duplicate-one.module.js +4 -1
- package/src/routes/duplicate-one/duplicate-one.module.js.map +1 -1
- package/src/routes/get-many/base-get-many.service.d.ts +0 -25
- package/src/routes/get-many/get-many-controller.mixin.js +1 -2
- package/src/routes/get-many/get-many-controller.mixin.js.map +1 -1
- package/src/routes/get-many/get-many-gateway.mixin.js +1 -2
- package/src/routes/get-many/get-many-gateway.mixin.js.map +1 -1
- package/src/routes/get-many/get-many.helper.js +3 -4
- package/src/routes/get-many/get-many.helper.js.map +1 -1
- package/src/routes/get-many/get-many.module.js +1 -1
- package/src/routes/get-many/get-many.module.js.map +1 -1
- package/src/routes/get-one/base-get-one.service.d.ts +0 -25
- package/src/routes/get-one/get-one-controller.mixin.js +1 -2
- package/src/routes/get-one/get-one-controller.mixin.js.map +1 -1
- package/src/routes/get-one/get-one-gateway.mixin.js +1 -2
- package/src/routes/get-one/get-one-gateway.mixin.js.map +1 -1
- package/src/routes/get-one/get-one.helper.js +3 -4
- package/src/routes/get-one/get-one.helper.js.map +1 -1
- package/src/routes/get-one/get-one.module.js +1 -1
- package/src/routes/get-one/get-one.module.js.map +1 -1
- package/src/routes/replace-one/base-replace-one.service.d.ts +0 -25
- package/src/routes/replace-one/replace-one-controller.interface.d.ts +2 -1
- package/src/routes/replace-one/replace-one-controller.mixin.d.ts +1 -1
- package/src/routes/replace-one/replace-one-controller.mixin.js +15 -8
- package/src/routes/replace-one/replace-one-controller.mixin.js.map +1 -1
- package/src/routes/replace-one/replace-one-gateway.mixin.js +1 -2
- package/src/routes/replace-one/replace-one-gateway.mixin.js.map +1 -1
- package/src/routes/replace-one/replace-one.helper.js +10 -7
- package/src/routes/replace-one/replace-one.helper.js.map +1 -1
- package/src/routes/replace-one/replace-one.module.js +4 -1
- package/src/routes/replace-one/replace-one.module.js.map +1 -1
- package/src/routes/update-many/base-update-many.service.d.ts +0 -25
- package/src/routes/update-many/update-many-controller.interface.d.ts +2 -1
- package/src/routes/update-many/update-many-controller.mixin.d.ts +1 -1
- package/src/routes/update-many/update-many-controller.mixin.js +15 -8
- package/src/routes/update-many/update-many-controller.mixin.js.map +1 -1
- package/src/routes/update-many/update-many-gateway.mixin.js +1 -2
- package/src/routes/update-many/update-many-gateway.mixin.js.map +1 -1
- package/src/routes/update-many/update-many.helper.js +10 -7
- package/src/routes/update-many/update-many.helper.js.map +1 -1
- package/src/routes/update-many/update-many.module.js +4 -1
- package/src/routes/update-many/update-many.module.js.map +1 -1
- package/src/routes/update-one/base-update-one.service.d.ts +0 -25
- package/src/routes/update-one/update-one-controller.interface.d.ts +2 -1
- package/src/routes/update-one/update-one-controller.mixin.d.ts +1 -1
- package/src/routes/update-one/update-one-controller.mixin.js +15 -8
- package/src/routes/update-one/update-one-controller.mixin.js.map +1 -1
- package/src/routes/update-one/update-one-gateway.mixin.js +1 -2
- package/src/routes/update-one/update-one-gateway.mixin.js.map +1 -1
- package/src/routes/update-one/update-one.helper.js +10 -7
- package/src/routes/update-one/update-one.helper.js.map +1 -1
- package/src/routes/update-one/update-one.module.js +4 -1
- package/src/routes/update-one/update-one.module.js.map +1 -1
- package/src/services/base/base.service.d.ts +0 -25
- package/src/services/dynamic-api-broadcast/dynamic-api-broadcast.service.d.ts +7 -0
- package/src/services/dynamic-api-broadcast/dynamic-api-broadcast.service.js +38 -0
- package/src/services/dynamic-api-broadcast/dynamic-api-broadcast.service.js.map +1 -0
- package/src/services/dynamic-api-global-state/dynamic-api-global-state.service.d.ts +0 -25
- package/src/services/index.d.ts +1 -0
- package/src/services/index.js +1 -0
- package/src/services/index.js.map +1 -1
- package/src/version.json +1 -1
- package/test/dynamic-api-for-feature.e2e-spec.js +162 -0
- package/test/dynamic-api-for-feature.e2e-spec.js.map +1 -1
- package/test/e2e.setup.d.ts +18 -32
- package/test/e2e.setup.js +63 -3
- package/test/e2e.setup.js.map +1 -1
- package/test/utils.d.ts +0 -25
- package/tsconfig.tsbuildinfo +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,51 @@
|
|
|
1
1
|
Changelog
|
|
2
2
|
|
|
3
|
+
## [3.2.1](https://github.com/MikeDev75015/mongodb-dynamic-api/compare/v3.2.0...v3.2.1) (2026-03-14)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
* resolve TypeScript breaking changes from dependency upgrades ([a836768](https://github.com/MikeDev75015/mongodb-dynamic-api/commit/a836768e4fc0609898ec3917aecbf677b1b74935))
|
|
7
|
+
|
|
8
|
+
## [3.2.0](https://github.com/MikeDev75015/mongodb-dynamic-api/compare/v3.1.0...v3.2.0) (2026-03-14)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### gateways
|
|
12
|
+
|
|
13
|
+
* **gateways:** add DynamicApiBroadcastGateway factory to capture ws server ([24d0e74](https://github.com/MikeDev75015/mongodb-dynamic-api/commit/24d0e748a973b6c0a5808225448c931417eac550))
|
|
14
|
+
* **gateways:** remove private modifier from server and broadcastService in DynamicApiBroadcastGateway ([cc9aed6](https://github.com/MikeDev75015/mongodb-dynamic-api/commit/cc9aed6e0b95a2f82ff6d6eac10d6d211e119249))
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### broadcast
|
|
18
|
+
|
|
19
|
+
* **broadcast:** use static wsServer in DynamicApiBroadcastService to share across DI scopes, separate broadcastService provider from gateway in write modules ([d7ded07](https://github.com/MikeDev75015/mongodb-dynamic-api/commit/d7ded072c35ed9d2680440da53143bb627936747))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### helpers
|
|
23
|
+
|
|
24
|
+
* **helpers:** always resolve event name in getMixinData for HTTP broadcast support ([8ddca98](https://github.com/MikeDev75015/mongodb-dynamic-api/commit/8ddca9855fe3ca8fea68ed5ef19665a07e42ad62))
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
### services
|
|
28
|
+
|
|
29
|
+
* **services:** add DynamicApiBroadcastService for HTTP broadcast support ([f8a4bca](https://github.com/MikeDev75015/mongodb-dynamic-api/commit/f8a4bca30b9d422407c4c7fbec22df32caeb9725))
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
### routes
|
|
33
|
+
|
|
34
|
+
* **routes:** declare hasBroadcast in write modules and remove from read-only modules ([543907d](https://github.com/MikeDev75015/mongodb-dynamic-api/commit/543907d2c9178ced1eb138ad3b3b154e1134a1e7))
|
|
35
|
+
* **routes:** inject optional broadcastService in 9 write-route controller mixins and helpers ([43af94a](https://github.com/MikeDev75015/mongodb-dynamic-api/commit/43af94a4cd5b08d200732bfa97fd5357d7200531))
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
### interfaces
|
|
39
|
+
|
|
40
|
+
* **interfaces:** add broadcastGatewayOptions to forRoot options and global state ([e24dba1](https://github.com/MikeDev75015/mongodb-dynamic-api/commit/e24dba1980f2b37ead56c0ff19f2e959e1911a27))
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
### auth
|
|
44
|
+
|
|
45
|
+
* **auth:** add DynamicApiGetAccountOptions type with callback and useInterceptors ([dc7f072](https://github.com/MikeDev75015/mongodb-dynamic-api/commit/dc7f07215e58ffc433dc27f93b7f4f99b4ef0dd4))
|
|
46
|
+
* **auth:** add useInterceptors support to getAccount on controller and gateway ([461fc4d](https://github.com/MikeDev75015/mongodb-dynamic-api/commit/461fc4d678a42d5568035b166a41c065df2d5525))
|
|
47
|
+
* **auth:** wire getAccount callback through service, module and helper ([c769e15](https://github.com/MikeDev75015/mongodb-dynamic-api/commit/c769e1559f7b7542723c0b35caf2198143d63b0a))
|
|
48
|
+
|
|
3
49
|
## [3.1.0](https://github.com/MikeDev75015/mongodb-dynamic-api/compare/v3.0.1...v3.1.0) (2026-03-08)
|
|
4
50
|
|
|
5
51
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mongodb-dynamic-api",
|
|
3
|
-
"version": "3.1
|
|
3
|
+
"version": "3.2.1",
|
|
4
4
|
"description": "Auto generated CRUD API for MongoDB using NestJS",
|
|
5
5
|
"readmeFilename": "README.md",
|
|
6
6
|
"main": "index.js",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"@nestjs/cache-manager": "^3.0.1",
|
|
44
44
|
"@nestjs/common": "^11.1.13",
|
|
45
45
|
"@nestjs/core": "^11.1.13",
|
|
46
|
-
"@nestjs/jwt": "^
|
|
46
|
+
"@nestjs/jwt": "^11.0.2",
|
|
47
47
|
"@nestjs/mongoose": "^11.0.4",
|
|
48
48
|
"@nestjs/passport": "^11.0.5",
|
|
49
49
|
"@nestjs/platform-express": "^11.1.13",
|
|
@@ -68,9 +68,9 @@
|
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
70
|
"@golevelup/ts-jest": "^0.4.0",
|
|
71
|
-
"@nestjs/cli": "^
|
|
72
|
-
"@nestjs/schematics": "^
|
|
73
|
-
"@nestjs/testing": "^
|
|
71
|
+
"@nestjs/cli": "^11.0.16",
|
|
72
|
+
"@nestjs/schematics": "^11.0.9",
|
|
73
|
+
"@nestjs/testing": "^11.1.16",
|
|
74
74
|
"@release-it/bumper": "^6.0.1",
|
|
75
75
|
"@release-it/conventional-changelog": "^8.0.1",
|
|
76
76
|
"@swc/cli": "^0.3.9",
|
|
@@ -82,11 +82,11 @@
|
|
|
82
82
|
"@types/passport-jwt": "^4.0.1",
|
|
83
83
|
"@types/passport-local": "^1.0.38",
|
|
84
84
|
"@types/supertest": "^6.0.2",
|
|
85
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
86
|
-
"@typescript-eslint/parser": "^
|
|
87
|
-
"eslint": "
|
|
88
|
-
"eslint-config-prettier": "^
|
|
89
|
-
"eslint-plugin-prettier": "^5.
|
|
85
|
+
"@typescript-eslint/eslint-plugin": "^8.57.0",
|
|
86
|
+
"@typescript-eslint/parser": "^8.57.0",
|
|
87
|
+
"eslint": "^10.0.3",
|
|
88
|
+
"eslint-config-prettier": "^10.1.8",
|
|
89
|
+
"eslint-plugin-prettier": "^5.5.5",
|
|
90
90
|
"jest": "^29.7.0",
|
|
91
91
|
"jest-junit": "^16.0.0",
|
|
92
92
|
"jest-mock-extended": "^3.0.5",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ApiEndpointVisibility =
|
|
3
|
+
exports.ApiEndpointVisibility = ApiEndpointVisibility;
|
|
4
4
|
const common_1 = require("@nestjs/common");
|
|
5
5
|
const swagger_1 = require("@nestjs/swagger");
|
|
6
6
|
function ApiEndpointVisibility(condition, decorator) {
|
|
@@ -8,5 +8,4 @@ function ApiEndpointVisibility(condition, decorator) {
|
|
|
8
8
|
const decoratorToApply = decorator ?? noopDecorator;
|
|
9
9
|
return (0, common_1.applyDecorators)(!condition ? (0, swagger_1.ApiExcludeEndpoint)() : decoratorToApply);
|
|
10
10
|
}
|
|
11
|
-
exports.ApiEndpointVisibility = ApiEndpointVisibility;
|
|
12
11
|
//# sourceMappingURL=api-endpoint-visibility.decorator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-endpoint-visibility.decorator.js","sourceRoot":"","sources":["../../../libs/dynamic-api/src/decorators/api-endpoint-visibility.decorator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"api-endpoint-visibility.decorator.js","sourceRoot":"","sources":["../../../libs/dynamic-api/src/decorators/api-endpoint-visibility.decorator.ts"],"names":[],"mappings":";;AAYS,sDAAqB;AAZ9B,2CAAkE;AAClE,6CAAqD;AAErD,SAAS,qBAAqB,CAC5B,SAAkB,EAClB,SAA6C;IAE7C,MAAM,aAAa,GAAoB,GAAG,EAAE,GAAE,CAAC,CAAC;IAChD,MAAM,gBAAgB,GAAG,SAAS,IAAI,aAAa,CAAC;IACpD,OAAO,IAAA,wBAAe,EAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAA,4BAAkB,GAAE,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC;AAC/E,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.DYNAMIC_API_SCHEMA_OPTIONS_METADATA = void 0;
|
|
4
|
+
exports.DynamicAPISchemaOptions = DynamicAPISchemaOptions;
|
|
4
5
|
const DYNAMIC_API_SCHEMA_OPTIONS_METADATA = 'dynamic-api-module:schema-options';
|
|
5
6
|
exports.DYNAMIC_API_SCHEMA_OPTIONS_METADATA = DYNAMIC_API_SCHEMA_OPTIONS_METADATA;
|
|
6
7
|
function DynamicAPISchemaOptions(options) {
|
|
@@ -8,5 +9,4 @@ function DynamicAPISchemaOptions(options) {
|
|
|
8
9
|
Reflect.defineMetadata(DYNAMIC_API_SCHEMA_OPTIONS_METADATA, options, target);
|
|
9
10
|
};
|
|
10
11
|
}
|
|
11
|
-
exports.DynamicAPISchemaOptions = DynamicAPISchemaOptions;
|
|
12
12
|
//# sourceMappingURL=schema-options.decorator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-options.decorator.js","sourceRoot":"","sources":["../../../libs/dynamic-api/src/decorators/schema-options.decorator.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"schema-options.decorator.js","sourceRoot":"","sources":["../../../libs/dynamic-api/src/decorators/schema-options.decorator.ts"],"names":[],"mappings":";;;AA2B8C,0DAAuB;AArBrE,MAAM,mCAAmC,GAAG,mCAAmC,CAAC;AAqBvE,kFAAmC;AAZ5C,SAAS,uBAAuB,CAC9B,OAAyC;IAEzC,OAAO,CAAC,MAAc,EAAE,EAAE;QACxB,OAAO,CAAC,cAAc,CACpB,mCAAmC,EACnC,OAAO,EACP,MAAM,CACP,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ValidatorPipe =
|
|
3
|
+
exports.ValidatorPipe = ValidatorPipe;
|
|
4
4
|
const common_1 = require("@nestjs/common");
|
|
5
5
|
function ValidatorPipe(validationPipeOptions) {
|
|
6
6
|
return validationPipeOptions ? (0, common_1.applyDecorators)((0, common_1.UsePipes)(new common_1.ValidationPipe(validationPipeOptions))) : (_) => undefined;
|
|
7
7
|
}
|
|
8
|
-
exports.ValidatorPipe = ValidatorPipe;
|
|
9
8
|
//# sourceMappingURL=validator-pipe.decorator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validator-pipe.decorator.js","sourceRoot":"","sources":["../../../libs/dynamic-api/src/decorators/validator-pipe.decorator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"validator-pipe.decorator.js","sourceRoot":"","sources":["../../../libs/dynamic-api/src/decorators/validator-pipe.decorator.ts"],"names":[],"mappings":";;AAQS,sCAAa;AARtB,2CAAkG;AAElG,SAAS,aAAa,CAAC,qBAA6C;IAClE,OAAO,qBAAqB,CAAC,CAAC,CAAC,IAAA,wBAAe,EAC5C,IAAA,iBAAQ,EAAC,IAAI,uBAAc,CAAC,qBAAqB,CAAC,CAAC,CACpD,CAAC,CAAC,CAAC,CAAC,CAAM,EAAE,EAAE,CAAC,SAAS,CAAC;AAC5B,CAAC"}
|
|
@@ -4,7 +4,7 @@ import { BaseEntity } from './models';
|
|
|
4
4
|
import { DynamicApiGlobalStateService } from './services';
|
|
5
5
|
export declare class DynamicApiModule {
|
|
6
6
|
static readonly state: DynamicApiGlobalStateService;
|
|
7
|
-
static forRoot<Entity extends BaseEntity = any>(uri: string, { useGlobalCache, cacheOptions, useAuth, routesConfig, webSocket, }?: DynamicApiForRootOptions<Entity>): DynamicModule;
|
|
7
|
+
static forRoot<Entity extends BaseEntity = any>(uri: string, { useGlobalCache, cacheOptions, useAuth, routesConfig, webSocket, broadcastGatewayOptions, }?: DynamicApiForRootOptions<Entity>): DynamicModule;
|
|
8
8
|
static forFeature<Entity extends BaseEntity>({ entity, controllerOptions, routes, webSocket: featureWebSocket, extraImports, extraProviders, extraControllers, }: DynamicApiForFeatureOptions<Entity>): Promise<DynamicModule>;
|
|
9
9
|
private static buildStateFromOptions;
|
|
10
10
|
private static setDefaultRoutes;
|
|
@@ -13,6 +13,7 @@ const common_1 = require("@nestjs/common");
|
|
|
13
13
|
const core_1 = require("@nestjs/core");
|
|
14
14
|
const http_adapter_host_1 = require("@nestjs/core/helpers/http-adapter-host");
|
|
15
15
|
const mongoose_1 = require("@nestjs/mongoose");
|
|
16
|
+
const gateways_1 = require("./gateways");
|
|
16
17
|
const guards_1 = require("./guards");
|
|
17
18
|
const helpers_1 = require("./helpers");
|
|
18
19
|
const interceptors_1 = require("./interceptors");
|
|
@@ -21,13 +22,13 @@ const modules_1 = require("./modules");
|
|
|
21
22
|
const routes_1 = require("./routes");
|
|
22
23
|
const services_1 = require("./services");
|
|
23
24
|
let DynamicApiModule = DynamicApiModule_1 = class DynamicApiModule {
|
|
24
|
-
static forRoot(uri, { useGlobalCache = true, cacheOptions = {}, useAuth, routesConfig, webSocket, } = {}) {
|
|
25
|
+
static forRoot(uri, { useGlobalCache = true, cacheOptions = {}, useAuth, routesConfig, webSocket, broadcastGatewayOptions, } = {}) {
|
|
25
26
|
if (!uri) {
|
|
26
27
|
throw new Error('You must provide a valid mongodb uri in the forRoot method to use MongoDB Dynamic API');
|
|
27
28
|
}
|
|
28
29
|
this.state.set([
|
|
29
30
|
'partial',
|
|
30
|
-
this.buildStateFromOptions(uri, useGlobalCache, cacheOptions, useAuth, routesConfig, webSocket),
|
|
31
|
+
this.buildStateFromOptions(uri, useGlobalCache, cacheOptions, useAuth, routesConfig, webSocket, broadcastGatewayOptions),
|
|
31
32
|
]);
|
|
32
33
|
return {
|
|
33
34
|
module: DynamicApiModule_1,
|
|
@@ -107,13 +108,19 @@ let DynamicApiModule = DynamicApiModule_1 = class DynamicApiModule {
|
|
|
107
108
|
return new guards_1.DynamicApiJwtAuthGuard(reflector, state);
|
|
108
109
|
},
|
|
109
110
|
},
|
|
111
|
+
...(routes.some((r) => r.broadcast) ? [
|
|
112
|
+
services_1.DynamicApiBroadcastService,
|
|
113
|
+
(0, gateways_1.createDynamicApiBroadcastGateway)(this.state.get('broadcastGatewayOptions')
|
|
114
|
+
?? this.state.get('gatewayOptions')
|
|
115
|
+
?? {}),
|
|
116
|
+
] : []),
|
|
110
117
|
],
|
|
111
118
|
};
|
|
112
119
|
resolve(apiModule);
|
|
113
120
|
});
|
|
114
121
|
});
|
|
115
122
|
}
|
|
116
|
-
static buildStateFromOptions(uri, useGlobalCache, cacheOptions, useAuth, routesConfig, webSocket) {
|
|
123
|
+
static buildStateFromOptions(uri, useGlobalCache, cacheOptions, useAuth, routesConfig, webSocket, broadcastGatewayOptions) {
|
|
117
124
|
const routesConfigState = this.state.get('routesConfig');
|
|
118
125
|
return {
|
|
119
126
|
uri,
|
|
@@ -137,6 +144,7 @@ let DynamicApiModule = DynamicApiModule_1 = class DynamicApiModule {
|
|
|
137
144
|
},
|
|
138
145
|
} : {}),
|
|
139
146
|
gatewayOptions: (0, helpers_1.initializeConfigFromOptions)(webSocket),
|
|
147
|
+
...(broadcastGatewayOptions ? { broadcastGatewayOptions } : {}),
|
|
140
148
|
};
|
|
141
149
|
}
|
|
142
150
|
static setDefaultRoutes(stateRoutesConfig, controllerRoutesConfig = {}, routes = []) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dynamic-api.module.js","sourceRoot":"","sources":["../../libs/dynamic-api/src/dynamic-api.module.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,yDAAmE;AACnE,2CAAuD;AACvD,uCAAqE;AACrE,8EAAyE;AACzE,+CAAkD;AAElD,qCAAkD;AAClD,
|
|
1
|
+
{"version":3,"file":"dynamic-api.module.js","sourceRoot":"","sources":["../../libs/dynamic-api/src/dynamic-api.module.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,yDAAmE;AACnE,2CAAuD;AACvD,uCAAqE;AACrE,8EAAyE;AACzE,+CAAkD;AAElD,yCAA8D;AAC9D,qCAAkD;AAClD,uCAA2H;AAC3H,iDAA4D;AAC5D,6CAAuQ;AAEvQ,uCAAsF;AACtF,qCAA4O;AAC5O,yCAAsF;AAQ/E,IAAM,gBAAgB,wBAAtB,MAAM,gBAAgB;IAc3B,MAAM,CAAC,OAAO,CACZ,GAAW,EACX,EACE,cAAc,GAAG,IAAI,EACrB,YAAY,GAAG,EAAE,EACjB,OAAO,EACP,YAAY,EACZ,SAAS,EACT,uBAAuB,MACa,EAAE;QAExC,IAAI,CAAC,GAAG,EAAE,CAAC;YACT,MAAM,IAAI,KAAK,CACb,uFAAuF,CACxF,CAAC;QACJ,CAAC;QAED,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC;YACb,SAAS;YACT,IAAI,CAAC,qBAAqB,CACxB,GAAG,EACH,cAAc,EACd,YAAY,EACZ,O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AAO,eAAe,IAAI,EAAE,IAAI,EAAE,CAAC;QACrC,CAAC,CAAC,CAAC,CAAC;IACN,CAAC;;AAzSU,4CAAgB;AAKX,sBAAK,GAAG,IAAI,uCAA4B,EAAE,AAArC,CAAsC;2BALhD,gBAAgB;IAD5B,IAAA,eAAM,EAAC,EAAE,CAAC;GACE,gBAAgB,CA0S5B"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Server } from 'socket.io';
|
|
2
|
+
import { GatewayOptions } from '../interfaces';
|
|
3
|
+
import { DynamicApiBroadcastService } from '../services';
|
|
4
|
+
declare function createDynamicApiBroadcastGateway(options?: GatewayOptions): {
|
|
5
|
+
new (broadcastService: DynamicApiBroadcastService): {
|
|
6
|
+
readonly server: Server;
|
|
7
|
+
readonly broadcastService: DynamicApiBroadcastService;
|
|
8
|
+
afterInit(server: Server): void;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
export { createDynamicApiBroadcastGateway };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.createDynamicApiBroadcastGateway = createDynamicApiBroadcastGateway;
|
|
16
|
+
const common_1 = require("@nestjs/common");
|
|
17
|
+
const websockets_1 = require("@nestjs/websockets");
|
|
18
|
+
const socket_io_1 = require("socket.io");
|
|
19
|
+
const services_1 = require("../services");
|
|
20
|
+
function createDynamicApiBroadcastGateway(options = {}) {
|
|
21
|
+
let DynamicApiBroadcastGateway = class DynamicApiBroadcastGateway {
|
|
22
|
+
constructor(broadcastService) {
|
|
23
|
+
this.broadcastService = broadcastService;
|
|
24
|
+
}
|
|
25
|
+
afterInit(server) {
|
|
26
|
+
this.broadcastService.setWsServer(server);
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, websockets_1.WebSocketServer)(),
|
|
31
|
+
__metadata("design:type", socket_io_1.Server)
|
|
32
|
+
], DynamicApiBroadcastGateway.prototype, "server", void 0);
|
|
33
|
+
DynamicApiBroadcastGateway = __decorate([
|
|
34
|
+
(0, websockets_1.WebSocketGateway)(options),
|
|
35
|
+
__param(0, (0, common_1.Inject)(services_1.DynamicApiBroadcastService)),
|
|
36
|
+
__metadata("design:paramtypes", [services_1.DynamicApiBroadcastService])
|
|
37
|
+
], DynamicApiBroadcastGateway);
|
|
38
|
+
return DynamicApiBroadcastGateway;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=dynamic-api-broadcast.gateway.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dynamic-api-broadcast.gateway.js","sourceRoot":"","sources":["../../../libs/dynamic-api/src/gateways/dynamic-api-broadcast.gateway.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAyBS,4EAAgC;AAzBzC,2CAAwC;AACxC,mDAAsF;AACtF,yCAAmC;AAEnC,0CAAyD;AAEzD,SAAS,gCAAgC,CAAC,UAA0B,EAAE;IACpE,IACM,0BAA0B,GADhC,MACM,0BAA0B;QAI9B,YAEW,gBAA4C;YAA5C,qBAAgB,GAAhB,gBAAgB,CAA4B;QACpD,CAAC;QAEJ,SAAS,CAAC,MAAc;YACtB,IAAI,CAAC,gBAAgB,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;QAC5C,CAAC;KACF,CAAA;IAVU;QADR,IAAA,4BAAe,GAAE;kCACD,kBAAM;8DAAC;IAFpB,0BAA0B;QAD/B,IAAA,6BAAgB,EAAC,OAAO,CAAC;QAMrB,WAAA,IAAA,eAAM,EAAC,qCAA0B,CAAC,CAAA;yCACR,qCAA0B;OANnD,0BAA0B,CAY/B;IAED,OAAO,0BAA0B,CAAC;AACpC,CAAC"}
|
package/src/gateways/index.d.ts
CHANGED
package/src/gateways/index.js
CHANGED
|
@@ -15,4 +15,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./base.gateway"), exports);
|
|
18
|
+
__exportStar(require("./dynamic-api-broadcast.gateway"), exports);
|
|
18
19
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../libs/dynamic-api/src/gateways/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA+B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../libs/dynamic-api/src/gateways/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA+B;AAC/B,kEAAgD"}
|
|
@@ -1,28 +1,3 @@
|
|
|
1
|
-
/// <reference types="mongoose/types/aggregate" />
|
|
2
|
-
/// <reference types="mongoose/types/callback" />
|
|
3
|
-
/// <reference types="mongoose/types/collection" />
|
|
4
|
-
/// <reference types="mongoose/types/connection" />
|
|
5
|
-
/// <reference types="mongoose/types/cursor" />
|
|
6
|
-
/// <reference types="mongoose/types/document" />
|
|
7
|
-
/// <reference types="mongoose/types/error" />
|
|
8
|
-
/// <reference types="mongoose/types/expressions" />
|
|
9
|
-
/// <reference types="mongoose/types/helpers" />
|
|
10
|
-
/// <reference types="mongoose/types/middlewares" />
|
|
11
|
-
/// <reference types="mongoose/types/indexes" />
|
|
12
|
-
/// <reference types="mongoose/types/models" />
|
|
13
|
-
/// <reference types="mongoose/types/mongooseoptions" />
|
|
14
|
-
/// <reference types="mongoose/types/pipelinestage" />
|
|
15
|
-
/// <reference types="mongoose/types/populate" />
|
|
16
|
-
/// <reference types="mongoose/types/query" />
|
|
17
|
-
/// <reference types="mongoose/types/schemaoptions" />
|
|
18
|
-
/// <reference types="mongoose/types/schematypes" />
|
|
19
|
-
/// <reference types="mongoose/types/session" />
|
|
20
|
-
/// <reference types="mongoose/types/types" />
|
|
21
|
-
/// <reference types="mongoose/types/utility" />
|
|
22
|
-
/// <reference types="mongoose/types/validation" />
|
|
23
|
-
/// <reference types="mongoose/types/virtuals" />
|
|
24
|
-
/// <reference types="mongoose/types/inferschematype" />
|
|
25
|
-
/// <reference types="mongoose/types/inferrawdoctype" />
|
|
26
1
|
import { CanActivate, ExecutionContext, Type } from '@nestjs/common';
|
|
27
2
|
import { PipelineStage } from 'mongodb-pipeline-builder';
|
|
28
3
|
import { Model } from 'mongoose';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getPredicateFromControllerAbilityPredicates =
|
|
3
|
+
exports.getPredicateFromControllerAbilityPredicates = getPredicateFromControllerAbilityPredicates;
|
|
4
4
|
function getPredicateFromControllerAbilityPredicates(controllerAbilityPredicates, route) {
|
|
5
5
|
let routePredicate;
|
|
6
6
|
if (!controllerAbilityPredicates?.length) {
|
|
@@ -15,5 +15,4 @@ function getPredicateFromControllerAbilityPredicates(controllerAbilityPredicates
|
|
|
15
15
|
}
|
|
16
16
|
return routePredicate;
|
|
17
17
|
}
|
|
18
|
-
exports.getPredicateFromControllerAbilityPredicates = getPredicateFromControllerAbilityPredicates;
|
|
19
18
|
//# sourceMappingURL=controller-ability-predicates.helper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"controller-ability-predicates.helper.js","sourceRoot":"","sources":["../../../libs/dynamic-api/src/helpers/controller-ability-predicates.helper.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"controller-ability-predicates.helper.js","sourceRoot":"","sources":["../../../libs/dynamic-api/src/helpers/controller-ability-predicates.helper.ts"],"names":[],"mappings":";;AA4BS,kGAA2C;AArBpD,SAAS,2CAA2C,CAClD,2BAAiE,EACjE,KAAgB;IAChB,IAAI,cAAwC,CAAC;IAE7C,IAAI,CAAC,2BAA2B,EAAE,MAAM,EAAE,CAAC;QACzC,OAAO;IACT,CAAC;IAED,KAAK,MAAM,0BAA0B,IAAI,2BAA2B,EAAE,CAAC;QACrE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,0BAA0B,CAAC;QAE1D,IAAI,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;YAC5B,cAAc,GAAG,SAAS,CAAC;YAC3B,MAAM;QACR,CAAC;IACH,CAAC;IAED,OAAO,cAAc,CAAC;AACxB,CAAC"}
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.pascalCase = pascalCase;
|
|
4
|
+
exports.isValidVersion = isValidVersion;
|
|
5
|
+
exports.getDisplayedName = getDisplayedName;
|
|
6
|
+
exports.provideName = provideName;
|
|
7
|
+
exports.isEmptyObject = isEmptyObject;
|
|
8
|
+
exports.isNotEmptyObject = isNotEmptyObject;
|
|
4
9
|
const lodash_1 = require("lodash");
|
|
5
10
|
const versioning_config_helper_1 = require("./versioning-config.helper");
|
|
6
11
|
function getNamePrefix(routeType, displayedName, version) {
|
|
@@ -9,25 +14,19 @@ function getNamePrefix(routeType, displayedName, version) {
|
|
|
9
14
|
function pascalCase(str) {
|
|
10
15
|
return str ? (0, lodash_1.upperFirst)((0, lodash_1.camelCase)(str)) : undefined;
|
|
11
16
|
}
|
|
12
|
-
exports.pascalCase = pascalCase;
|
|
13
17
|
function isValidVersion(version) {
|
|
14
18
|
return /^\d+$/.test(version);
|
|
15
19
|
}
|
|
16
|
-
exports.isValidVersion = isValidVersion;
|
|
17
20
|
function getDisplayedName(apiTag, entityName, subPath) {
|
|
18
21
|
return pascalCase(`${subPath ? subPath + '-' : ''}${apiTag ?? entityName}`);
|
|
19
22
|
}
|
|
20
|
-
exports.getDisplayedName = getDisplayedName;
|
|
21
23
|
function provideName(routeType, displayedName, version, suffix) {
|
|
22
24
|
return `${getNamePrefix(routeType, displayedName, version)}${suffix}`;
|
|
23
25
|
}
|
|
24
|
-
exports.provideName = provideName;
|
|
25
26
|
function isEmptyObject(obj) {
|
|
26
27
|
return obj ? typeof obj === 'object' && Object.keys(obj).length === 0 : true;
|
|
27
28
|
}
|
|
28
|
-
exports.isEmptyObject = isEmptyObject;
|
|
29
29
|
function isNotEmptyObject(obj) {
|
|
30
30
|
return !isEmptyObject(obj);
|
|
31
31
|
}
|
|
32
|
-
exports.isNotEmptyObject = isNotEmptyObject;
|
|
33
32
|
//# sourceMappingURL=format.helper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format.helper.js","sourceRoot":"","sources":["../../../libs/dynamic-api/src/helpers/format.helper.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"format.helper.js","sourceRoot":"","sources":["../../../libs/dynamic-api/src/helpers/format.helper.ts"],"names":[],"mappings":";;AAsCE,gCAAU;AACV,wCAAc;AACd,4CAAgB;AAChB,kCAAW;AACX,sCAAa;AACb,4CAAgB;AA3ClB,mCAA+C;AAE/C,yEAA8D;AAE9D,SAAS,aAAa,CAAC,SAAoB,EAAE,aAAqB,EAAE,OAA2B;IA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
4
4
|
const lodash_1 = require("lodash");
|
|
5
5
|
const controller_ability_predicates_helper_1 = require("./controller-ability-predicates.helper");
|
|
6
6
|
const format_helper_1 = require("./format.helper");
|
|
@@ -17,14 +17,14 @@ function getMixinData(entity, { apiTag, isPublic: isPublicController, abilityPre
|
|
|
17
17
|
isPublic = false;
|
|
18
18
|
}
|
|
19
19
|
const abilityPredicate = routeAbilityPredicate ?? (0, controller_ability_predicates_helper_1.getPredicateFromControllerAbilityPredicates)(controllerAbilityPredicates, routeType);
|
|
20
|
+
const event = eventName ?? (0, lodash_1.kebabCase)(`${routeType}/${displayedName}`);
|
|
20
21
|
return {
|
|
21
22
|
routeType,
|
|
22
23
|
displayedName,
|
|
23
24
|
description,
|
|
24
25
|
isPublic,
|
|
25
26
|
abilityPredicate,
|
|
26
|
-
|
|
27
|
+
event,
|
|
27
28
|
};
|
|
28
29
|
}
|
|
29
|
-
exports.getMixinData = getMixinData;
|
|
30
30
|
//# sourceMappingURL=mixin-data.helper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mixin-data.helper.js","sourceRoot":"","sources":["../../../libs/dynamic-api/src/helpers/mixin-data.helper.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mixin-data.helper.js","sourceRoot":"","sources":["../../../libs/dynamic-api/src/helpers/mixin-data.helper.ts"],"names":[],"mappings":";;AAgES,oCAAY;AA/DrB,mCAAmC;AAQnC,iGAAqG;AACrG,mDAAmD;AAEnD,SAAS,YAAY,CACnB,MAAoB,EACpB,EACE,MAAM,EACN,QAAQ,EAAE,kBAAkB,EAC5B,iBAAiB,EAAE,2BAA2B,GACV,EACtC,EACE,IAAI,EAAE,SAAS,EACf,OAAO,EACP,WAAW,EACX,QAAQ,EAAE,aAAa,EACvB,gBAAgB,EAAE,qBAAqB,EACvC,SAAS,GACqB,EAChC,SAAS,GAAG,KAAK;IASjB,MAAM,aAAa,GAAG,IAAA,gCAAgB,EAAC,MAAM,EAAG,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAEtE,IAAI,QAAiB,CAAC;IACtB,IAAI,OAAO,aAAa,KAAK,SAAS,EAAE,CAAC;QACvC,QAAQ,GAAG,aAAa,CAAC;IAC3B,CAAC;SAAM,IAAI,OAAO,kBAAkB,KAAK,SAAS,EAAE,CAAC;QACnD,QAAQ,GAAG,kBAAkB,CAAC;IAChC,CAAC;SAAM,CAAC;QACN,QAAQ,GAAG,KAAK,CAAC;IACnB,CAAC;IAED,MAAM,gBAAgB,GAAG,qBAAqB,IAAI,IAAA,kFAA2C,EAC3F,2BAA2B,EAC3B,SAAS,CACV,CAAC;IAEF,MAAM,KAAK,GAAG,SAAS,IAAI,IAAA,kBAAS,EAAC,GAAG,SAAS,IAAI,aAAa,EAAE,CAAC,CAAC;IAEtE,OAAO;QACL,SAAS;QACT,aAAa;QACb,WAAW;QACX,QAAQ;QACR,gBAAgB;QAChB,KAAK;KACN,CAAC;AACJ,CAAC"}
|
|
@@ -1,28 +1,3 @@
|
|
|
1
|
-
/// <reference types="mongoose/types/aggregate" />
|
|
2
|
-
/// <reference types="mongoose/types/callback" />
|
|
3
|
-
/// <reference types="mongoose/types/collection" />
|
|
4
|
-
/// <reference types="mongoose/types/connection" />
|
|
5
|
-
/// <reference types="mongoose/types/cursor" />
|
|
6
|
-
/// <reference types="mongoose/types/document" />
|
|
7
|
-
/// <reference types="mongoose/types/error" />
|
|
8
|
-
/// <reference types="mongoose/types/expressions" />
|
|
9
|
-
/// <reference types="mongoose/types/helpers" />
|
|
10
|
-
/// <reference types="mongoose/types/middlewares" />
|
|
11
|
-
/// <reference types="mongoose/types/indexes" />
|
|
12
|
-
/// <reference types="mongoose/types/models" />
|
|
13
|
-
/// <reference types="mongoose/types/mongooseoptions" />
|
|
14
|
-
/// <reference types="mongoose/types/pipelinestage" />
|
|
15
|
-
/// <reference types="mongoose/types/populate" />
|
|
16
|
-
/// <reference types="mongoose/types/query" />
|
|
17
|
-
/// <reference types="mongoose/types/schemaoptions" />
|
|
18
|
-
/// <reference types="mongoose/types/schematypes" />
|
|
19
|
-
/// <reference types="mongoose/types/session" />
|
|
20
|
-
/// <reference types="mongoose/types/types" />
|
|
21
|
-
/// <reference types="mongoose/types/utility" />
|
|
22
|
-
/// <reference types="mongoose/types/validation" />
|
|
23
|
-
/// <reference types="mongoose/types/virtuals" />
|
|
24
|
-
/// <reference types="mongoose/types/inferschematype" />
|
|
25
|
-
/// <reference types="mongoose/types/inferrawdoctype" />
|
|
26
1
|
import { Type } from '@nestjs/common';
|
|
27
2
|
import { GetPagingResultResponse, GetResultResponse, PipelineStage } from 'mongodb-pipeline-builder';
|
|
28
3
|
import { FilterQuery, QueryOptions } from 'mongoose';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repository.helper.js","sourceRoot":"","sources":["../../../libs/dynamic-api/src/helpers/repository.helper.ts"],"names":[],"mappings":";;;AACA,uEAMkC;AAGlC,0CAA2D;AAiB3D,MAAM,gBAAgB;IACb,MAAM,CAAC,KAAK,CAAC,aAAa,CAA4B,MAAoB;QAC/E,MAAM,KAAK,GAAG,MAAM,uCAA4B,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;QAExE,OAAO;YACL,SAAS,EAAE,CAAC,QAAyB,EAAE,EAAE,CAAC,gBAAgB,CAAC,SAAS,CAAS,KAAK,EAAE,QAAQ,CAAC;YAC7F,UAAU,EAAE,CAAC,YAA+B,EAAE,EAAE,CAAC,gBAAgB,CAAC,UAAU,CAAS,KAAK,EAAE,YAAY,CAAC;YACzG,MAAM,EAAE,CAAC,QAAgB,EAAE,EAAE,CAAC,gBAAgB,CAAC,MAAM,CAAS,KAAK,EAAE,QAAQ,CAAC;YAC9E,MAAM,EAAE,CAAC,KAAyC,EAAE,EAAE,CAAC,gBAAgB,CAAC,MAAM,CAAS,KAAK,EAAE,KAAK,CAAC;YACpG,IAAI,EAAE,CAAC,KAA0B,EAAE,EAAE,CAAC,gBAAgB,CAAC,IAAI,CA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CAAC,KAAK,CAAC,MAAM,CAAuB,KAAe,EAAE,KAGlE;QACC,IAAI,KAAK,CAAC,EAAE,EAAE,CAAC;YACb,MAAM,EAAE,YAAY,EAAE,GAAG,MAAM,KAAK,CAAC,SAAS,CAAC,EAAE,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;YACzE,OAAO,YAAY,KAAK,CAAC,CAAC;QAC5B,CAAC;aAAM,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC;YACxB,MAAM,EAAE,YAAY,EAAE,GAAG,MAAM,KAAK,CAAC,UAAU,CAAC,EAAE,GAAG,EAAE,EAAE,GAAG,EAAE,KAAK,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;YACvF,OAAO,YAAY,KAAK,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC;QAC9C,CAAC;aAAM,CAAC;YACN,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;IAEO,MAAM,CAAC,KAAK,CAAC,UAAU,CAAuB,KAAe,EAAE,QAAsB;QAC3F,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QAE9C,OAAO,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,MAAM,CAAC,QAAQ,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAQ,CAAC;IAC9F,CAAC;CACF;AAEQ,4CAAgB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { DynamicApiDecoratorBuilder } from '../interfaces';
|
|
2
2
|
import { BaseEntity } from '../models';
|
|
3
|
-
declare function RouteDecoratorsHelper<Entity extends BaseEntity>(routeDecorators: DynamicApiDecoratorBuilder<Entity>): <TFunction extends Function, Y>(target:
|
|
3
|
+
declare function RouteDecoratorsHelper<Entity extends BaseEntity>(routeDecorators: DynamicApiDecoratorBuilder<Entity>): <TFunction extends Function, Y>(target: TFunction | object, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
|
|
4
4
|
export { RouteDecoratorsHelper };
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RouteDecoratorsHelper =
|
|
3
|
+
exports.RouteDecoratorsHelper = RouteDecoratorsHelper;
|
|
4
4
|
const common_1 = require("@nestjs/common");
|
|
5
5
|
function RouteDecoratorsHelper(routeDecorators) {
|
|
6
6
|
return (0, common_1.applyDecorators)(...routeDecorators.build());
|
|
7
7
|
}
|
|
8
|
-
exports.RouteDecoratorsHelper = RouteDecoratorsHelper;
|
|
9
8
|
//# sourceMappingURL=route-decorators.helper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route-decorators.helper.js","sourceRoot":"","sources":["../../../libs/dynamic-api/src/helpers/route-decorators.helper.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"route-decorators.helper.js","sourceRoot":"","sources":["../../../libs/dynamic-api/src/helpers/route-decorators.helper.ts"],"names":[],"mappings":";;AAUS,sDAAqB;AAV9B,2CAAiD;AAIjD,SAAS,qBAAqB,CAC5B,eAAmD;IAEnD,OAAO,IAAA,wBAAe,EAAC,GAAG,eAAe,CAAC,KAAK,EAAE,CAAC,CAAC;AACrD,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getDefaultRouteDescription =
|
|
3
|
+
exports.getDefaultRouteDescription = getDefaultRouteDescription;
|
|
4
4
|
const lodash_1 = require("lodash");
|
|
5
5
|
function getDefaultRouteDescription(routeType, entityName) {
|
|
6
6
|
const contentName = (0, lodash_1.lowerCase)(entityName);
|
|
@@ -33,5 +33,4 @@ function getDefaultRouteDescription(routeType, entityName) {
|
|
|
33
33
|
throw new Error(`Route type "${routeType}" is not supported`);
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
|
-
exports.getDefaultRouteDescription = getDefaultRouteDescription;
|
|
37
36
|
//# sourceMappingURL=route-description.helper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route-description.helper.js","sourceRoot":"","sources":["../../../libs/dynamic-api/src/helpers/route-description.helper.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"route-description.helper.js","sourceRoot":"","sources":["../../../libs/dynamic-api/src/helpers/route-description.helper.ts"],"names":[],"mappings":";;AAoCS,gEAA0B;AApCnC,mCAAmC;AAGnC,SAAS,0BAA0B,CAAC,SAAoB,EAAE,UAAkB;IAC1E,MAAM,WAAW,GAAG,IAAA,kBAAS,EAAC,UAAU,CAAC,CAAC;IAE1C,QAAQ,SAAS,EAAE,CAAC;QAClB,KAAK,YAAY;YACf,OAAO,eAAe,WAAW,EAAE,CAAC;QACtC,KAAK,WAAW;YACd,OAAO,cAAc,WAAW,EAAE,CAAC;QACrC,KAAK,YAAY;YACf,OAAO,eAAe,WAAW,EAAE,CAAC;QACtC,KAAK,WAAW;YACd,OAAO,cAAc,WAAW,EAAE,CAAC;QACrC,KAAK,eAAe;YAClB,OAAO,kBAAkB,WAAW,EAAE,CAAC;QACzC,KAAK,cAAc;YACjB,OAAO,iBAAiB,WAAW,EAAE,CAAC;QACxC,KAAK,SAAS;YACZ,OAAO,YAAY,WAAW,EAAE,CAAC;QACnC,KAAK,QAAQ;YACX,OAAO,WAAW,WAAW,QAAQ,CAAC;QACxC,KAAK,YAAY;YACf,OAAO,eAAe,WAAW,EAAE,CAAC;QACtC,KAAK,YAAY;YACf,OAAO,eAAe,WAAW,EAAE,CAAC;QACtC,KAAK,WAAW;YACd,OAAO,cAAc,WAAW,EAAE,CAAC;QACrC,KAAK,WAAW;YACd,OAAO,kBAAkB,WAAW,EAAE,CAAC;QACzC;YACE,MAAM,IAAI,KAAK,CAAC,eAAe,SAAS,oBAAoB,CAAC,CAAC;IAClE,CAAC;AACH,CAAC"}
|
|
@@ -1,28 +1,3 @@
|
|
|
1
|
-
/// <reference types="mongoose/types/aggregate" />
|
|
2
|
-
/// <reference types="mongoose/types/callback" />
|
|
3
|
-
/// <reference types="mongoose/types/collection" />
|
|
4
|
-
/// <reference types="mongoose/types/connection" />
|
|
5
|
-
/// <reference types="mongoose/types/cursor" />
|
|
6
|
-
/// <reference types="mongoose/types/document" />
|
|
7
|
-
/// <reference types="mongoose/types/error" />
|
|
8
|
-
/// <reference types="mongoose/types/expressions" />
|
|
9
|
-
/// <reference types="mongoose/types/helpers" />
|
|
10
|
-
/// <reference types="mongoose/types/middlewares" />
|
|
11
|
-
/// <reference types="mongoose/types/indexes" />
|
|
12
|
-
/// <reference types="mongoose/types/models" />
|
|
13
|
-
/// <reference types="mongoose/types/mongooseoptions" />
|
|
14
|
-
/// <reference types="mongoose/types/pipelinestage" />
|
|
15
|
-
/// <reference types="mongoose/types/populate" />
|
|
16
|
-
/// <reference types="mongoose/types/query" />
|
|
17
|
-
/// <reference types="mongoose/types/schemaoptions" />
|
|
18
|
-
/// <reference types="mongoose/types/schematypes" />
|
|
19
|
-
/// <reference types="mongoose/types/session" />
|
|
20
|
-
/// <reference types="mongoose/types/types" />
|
|
21
|
-
/// <reference types="mongoose/types/utility" />
|
|
22
|
-
/// <reference types="mongoose/types/validation" />
|
|
23
|
-
/// <reference types="mongoose/types/virtuals" />
|
|
24
|
-
/// <reference types="mongoose/types/inferschematype" />
|
|
25
|
-
/// <reference types="mongoose/types/inferrawdoctype" />
|
|
26
1
|
import { Type } from '@nestjs/common';
|
|
27
2
|
import { Schema } from 'mongoose';
|
|
28
3
|
declare function buildSchemaFromEntity<Entity>(entity: Type<Entity>): Schema<Entity>;
|