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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.buildSchemaFromEntity =
|
|
3
|
+
exports.buildSchemaFromEntity = buildSchemaFromEntity;
|
|
4
4
|
const mongoose_1 = require("@nestjs/mongoose");
|
|
5
5
|
const decorators_1 = require("../decorators");
|
|
6
6
|
const interfaces_1 = require("../interfaces");
|
|
@@ -26,5 +26,4 @@ function buildSchemaFromEntity(entity) {
|
|
|
26
26
|
}
|
|
27
27
|
return schema;
|
|
28
28
|
}
|
|
29
|
-
exports.buildSchemaFromEntity = buildSchemaFromEntity;
|
|
30
29
|
//# sourceMappingURL=schema.helper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.helper.js","sourceRoot":"","sources":["../../../libs/dynamic-api/src/helpers/schema.helper.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3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,CAAC,kBAAkB,CAAC,CAAC,CAAC,KAAK,EAClE,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,EAC3C,QAAQ,CACT,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;IAED,IAAI,aAAa,EAAE,UAAU,EAAE,CAAC;QAC9B,aAAa,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;IACnC,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.initializeConfigFromOptions = initializeConfigFromOptions;
|
|
4
|
+
exports.enableDynamicAPIWebSockets = enableDynamicAPIWebSockets;
|
|
4
5
|
const socket_adapter_1 = require("../adapters/socket-adapter");
|
|
5
6
|
function initEventsListeners(maxListeners = 10) {
|
|
6
7
|
require('events').EventEmitter.prototype._maxListeners = 100;
|
|
@@ -19,12 +20,10 @@ function enableDynamicAPIWebSockets(app, maxListeners) {
|
|
|
19
20
|
});
|
|
20
21
|
app.useWebSocketAdapter(new socket_adapter_1.SocketAdapter(app));
|
|
21
22
|
}
|
|
22
|
-
exports.enableDynamicAPIWebSockets = enableDynamicAPIWebSockets;
|
|
23
23
|
function initializeConfigFromOptions(options) {
|
|
24
24
|
if (!options) {
|
|
25
25
|
return;
|
|
26
26
|
}
|
|
27
27
|
return typeof options === 'boolean' ? {} : options;
|
|
28
28
|
}
|
|
29
|
-
exports.initializeConfigFromOptions = initializeConfigFromOptions;
|
|
30
29
|
//# sourceMappingURL=socket-config.helper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"socket-config.helper.js","sourceRoot":"","sources":["../../../libs/dynamic-api/src/helpers/socket-config.helper.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"socket-config.helper.js","sourceRoot":"","sources":["../../../libs/dynamic-api/src/helpers/socket-config.helper.ts"],"names":[],"mappings":";;AAsCS,kEAA2B;AAAE,gEAA0B;AArChE,+DAA2D;AAG3D,SAAS,mBAAmB,CAAC,YAAY,GAAG,EAAE;IAC5C,OAAO,CAAC,QAAQ,CAAC,CAAC,YAAY,CAAC,SAAS,CAAC,aAAa,GAAG,GAAG,CAAC;IAC7D,OAAO,CAAC,QAAQ,CAAC,CAAC,mBAAmB,GAAG,GAAG,CAAC;IAC5C,OAAO,CAAC,QAAQ,CAAC,CAAC,YAAY,CAAC,SAAS,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC;AACzE,CAAC;AAOD,SAAS,0BAA0B,CAAC,GAAqB,EAAE,YAAqB;IAC9E,mBAAmB,CAAC,YAAY,CAAC,CAAC;IAElC,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,UAAU,GAAG;QACjC,IAAI,6BAA6B,KAAK,GAAG,CAAC,IAAI,EAAE,CAAC;YAC/C,OAAO,CAAC,IAAI,CAAC,6EAA6E,CAAC,CAAC;YAC5F,OAAO,CAAC,IAAI,CAAC,2FAA2F,CAAC,CAAC;YAC1G,OAAO,CAAC,IAAI,CAAC,8CAA8C,CAAC,CAAC;YAC7D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,GAAG,CAAC,mBAAmB,CAAC,IAAI,8BAAa,CAAC,GAAG,CAAC,CAAC,CAAC;AAClD,CAAC;AAED,SAAS,2BAA2B,CAAC,OAAoC;IACvE,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO;IACT,CAAC;IAED,OAAO,OAAO,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC;AACrD,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.enableDynamicAPISwagger =
|
|
3
|
+
exports.enableDynamicAPISwagger = enableDynamicAPISwagger;
|
|
4
4
|
const swagger_1 = require("@nestjs/swagger");
|
|
5
5
|
const fs = require("node:fs");
|
|
6
6
|
const version_json_1 = require("../version.json");
|
|
@@ -112,5 +112,4 @@ function enableDynamicAPISwagger(app, options) {
|
|
|
112
112
|
}
|
|
113
113
|
swagger_1.SwaggerModule.setup(path, app, document);
|
|
114
114
|
}
|
|
115
|
-
exports.enableDynamicAPISwagger = enableDynamicAPISwagger;
|
|
116
115
|
//# sourceMappingURL=swagger-config.helper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"swagger-config.helper.js","sourceRoot":"","sources":["../../../libs/dynamic-api/src/helpers/swagger-config.helper.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"swagger-config.helper.js","sourceRoot":"","sources":["../../../libs/dynamic-api/src/helpers/swagger-config.helper.ts"],"names":[],"mappings":";;AAsJS,0DAAuB;AArJhC,6CAAiE;AACjE,8BAA8B;AAE9B,kDAAuC;AAEvC,SAAS,gBAAgB,CACvB,MAAuB,EACvB,aAA2C;IAE3C,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;QACzC,MAAM,KAAK,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC;QAEjC,QAAQ,GAAG,EAAE,CAAC;YACZ,KAAK,gBAAgB;gBACnB,MAAM,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;gBAChC,MAAM;YAER,KAAK,SAAS;gBACZ,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;gBACtD,MAAM;YAER,KAAK,SAAS;gBACZ,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;gBACzC,MAAM;YAER,KAAK,SAAS;gBACZ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,CAAC,CAAC;gBAC5E,CAAC;gBACD,MAAM;YAER;gBACE,MAAM;QACV,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AAED,SAAS,uBAAuB,CAC9B,GAAqB,EACrB,OAAkC;IAElC,MAAM,WAAW,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAC/C,MAAM,EACJ,KAAK,GAAG,qBAAqB,EAC7B,WAAW,GAAG,iCAAiC,EAC/C,OAAO,GAAG,CAAC,sBAAQ,IAAI,WAAW,CAAC,EAAE,OAAO,EAC5C,IAAI,GAAG,cAAc,EACrB,kBAAkB,EAClB,sBAAsB,GACvB,GAAG,OAAO,IAAI,EAAE,CAAC;IAElB,MAAM,MAAM,GAAG,IAAI,yBAAe,EAAE;SACnC,QAAQ,CAAC,KAAK,CAAC;SACf,cAAc,CAAC,WAAW,CAAC;SAC3B,UAAU,CAAC,OAAO,CAAC,CAAC;IAErB,IAAI,kBAAkB,EAAE,CAAC;QACvB,gBAAgB,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;IAC/C,CAAC;IAED,MAAM,QAAQ,GAAG,uBAAa,CAAC,cAAc,CAAC,GAAG,EAAE,MAAM,CAAC,KAAK,EAAE,EAAE,sBAAsB,CAAC,CAAC;IAE3F,IAAI,OAAO,EAAE,YAAY,EAAE,CAAC;QAC1B,EAAE,CAAC,aAAa,CAAC,OAAO,EAAE,YAAY,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IAC7E,CAAC;IAED,uBAAa,CAAC,KAAK,CACjB,IAAI,EACJ,GAAG,EACH,QAAQ,CACT,CAAC;AACJ,CAAC"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.enableDynamicAPIValidation =
|
|
3
|
+
exports.enableDynamicAPIValidation = enableDynamicAPIValidation;
|
|
4
4
|
const common_1 = require("@nestjs/common");
|
|
5
5
|
function enableDynamicAPIValidation(app, options = {}) {
|
|
6
6
|
app.useGlobalPipes(new common_1.ValidationPipe(options));
|
|
7
7
|
}
|
|
8
|
-
exports.enableDynamicAPIValidation = enableDynamicAPIValidation;
|
|
9
8
|
//# sourceMappingURL=validation-config.helper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation-config.helper.js","sourceRoot":"","sources":["../../../libs/dynamic-api/src/helpers/validation-config.helper.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"validation-config.helper.js","sourceRoot":"","sources":["../../../libs/dynamic-api/src/helpers/validation-config.helper.ts"],"names":[],"mappings":";;AAaS,gEAA0B;AAbnC,2CAIwB;AAGxB,SAAS,0BAA0B,CAAC,GAAqB,EAAE,UAAiC,EAAE;IAC5F,GAAG,CAAC,cAAc,CAChB,IAAI,uBAAc,CAAC,OAAO,CAAC,CAC5B,CAAC;AACJ,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.addVersionSuffix = addVersionSuffix;
|
|
4
|
+
exports.enableDynamicAPIVersioning = enableDynamicAPIVersioning;
|
|
4
5
|
const common_1 = require("@nestjs/common");
|
|
5
6
|
function enableDynamicAPIVersioning(app, options) {
|
|
6
7
|
app.enableVersioning({
|
|
@@ -8,9 +9,7 @@ function enableDynamicAPIVersioning(app, options) {
|
|
|
8
9
|
...options,
|
|
9
10
|
});
|
|
10
11
|
}
|
|
11
|
-
exports.enableDynamicAPIVersioning = enableDynamicAPIVersioning;
|
|
12
12
|
function addVersionSuffix(version) {
|
|
13
13
|
return version ? `V${version}` : '';
|
|
14
14
|
}
|
|
15
|
-
exports.addVersionSuffix = addVersionSuffix;
|
|
16
15
|
//# sourceMappingURL=versioning-config.helper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"versioning-config.helper.js","sourceRoot":"","sources":["../../../libs/dynamic-api/src/helpers/versioning-config.helper.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"versioning-config.helper.js","sourceRoot":"","sources":["../../../libs/dynamic-api/src/helpers/versioning-config.helper.ts"],"names":[],"mappings":";;AAgBS,4CAAgB;AAAE,gEAA0B;AAhBrD,2CAAqF;AAErF,SAAS,0BAA0B,CACjC,GAAqB,EACrB,OAA2B;IAE3B,GAAG,CAAC,gBAAgB,CAAC;QACnB,IAAI,EAAE,uBAAc,CAAC,GAAG;QACxB,GAAG,OAAO;KACX,CAAC,CAAC;AACL,CAAC;AAED,SAAS,gBAAgB,CAAC,OAAgB;IACxC,OAAO,OAAO,CAAC,CAAC,CAAC,IAAI,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;AACtC,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 { GatewayMetadata } from '@nestjs/websockets';
|
|
27
2
|
import { Schema } from 'mongoose';
|
|
28
3
|
import { RouteType } from './dynamic-api-route-type.type';
|
|
@@ -49,5 +24,6 @@ interface DynamicApiGlobalState {
|
|
|
49
24
|
jwtExpirationTime: string | number | undefined;
|
|
50
25
|
routesConfig: RoutesConfig;
|
|
51
26
|
gatewayOptions: GatewayMetadata | undefined;
|
|
27
|
+
broadcastGatewayOptions: GatewayMetadata | undefined;
|
|
52
28
|
}
|
|
53
29
|
export { DynamicApiGlobalState, Credentials, EntitySchemas, RoutesConfig };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ModuleMetadata, Type } from '@nestjs/common';
|
|
2
|
+
import { GatewayMetadata } from '@nestjs/websockets';
|
|
2
3
|
import { BaseEntity } from '../models';
|
|
3
4
|
import { DynamicApiAuthOptions } from '../modules';
|
|
4
5
|
import { DynamicApiControllerOptions } from './dynamic-api-controller-options.interface';
|
|
@@ -13,6 +14,7 @@ interface DynamicApiForRootOptions<Entity extends BaseEntity = any> {
|
|
|
13
14
|
useAuth?: DynamicApiAuthOptions<Entity>;
|
|
14
15
|
routesConfig?: Partial<RoutesConfig>;
|
|
15
16
|
webSocket?: DynamicApiWebSocketOptions;
|
|
17
|
+
broadcastGatewayOptions?: GatewayMetadata;
|
|
16
18
|
}
|
|
17
19
|
interface DynamicApiForFeatureOptions<Entity extends BaseEntity> {
|
|
18
20
|
entity: Type<Entity>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dynamic-api-options.interface.js","sourceRoot":"","sources":["../../../libs/dynamic-api/src/interfaces/dynamic-api-options.interface.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"dynamic-api-options.interface.js","sourceRoot":"","sources":["../../../libs/dynamic-api/src/interfaces/dynamic-api-options.interface.ts"],"names":[],"mappings":";;;AAUA,MAAM,wBAAwB,GAAG,MAAM,CAAC,0BAA0B,CAAC,CAAC;AAqBJ,4DAAwB"}
|
|
@@ -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 { ExecutionContext } from '@nestjs/common';
|
|
27
2
|
import { Model } from 'mongoose';
|
|
28
3
|
import { BaseEntity } from '../models';
|
|
@@ -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 { IndexDefinition, IndexOptions, Schema } from 'mongoose';
|
|
27
2
|
import { RouteType } from './dynamic-api-route-type.type';
|
|
28
3
|
type HookEvent = RouteType;
|
|
@@ -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 { PipelineStage } from 'mongodb-pipeline-builder';
|
|
28
3
|
import { FilterQuery, UpdateQuery, UpdateWithAggregationPipeline } from 'mongoose';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.baseEntityKeysToExclude = void 0;
|
|
4
|
+
exports.EntityBodyMixin = EntityBodyMixin;
|
|
4
5
|
const swagger_1 = require("@nestjs/swagger");
|
|
5
6
|
const baseEntityKeysToExclude = () => [
|
|
6
7
|
'id',
|
|
@@ -21,5 +22,4 @@ function EntityBodyMixin(entity, optional = false, additionalKeysToExclude) {
|
|
|
21
22
|
}
|
|
22
23
|
return optional ? (0, swagger_1.PartialType)(EntityBody) : EntityBody;
|
|
23
24
|
}
|
|
24
|
-
exports.EntityBodyMixin = EntityBodyMixin;
|
|
25
25
|
//# sourceMappingURL=entity-body.mixin.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entity-body.mixin.js","sourceRoot":"","sources":["../../../libs/dynamic-api/src/mixins/entity-body.mixin.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"entity-body.mixin.js","sourceRoot":"","sources":["../../../libs/dynamic-api/src/mixins/entity-body.mixin.ts"],"names":[],"mappings":";;;AA+BkC,0CAAe;AA9BjD,6CAAwD;AAGxD,MAAM,uBAAuB,GAAG,GAA8B,EAAE,CAC9D;IACE,IAAI;IACJ,WAAW;IACX,WAAW;IACX,WAAW;IACX,WAAW;IACX,KAAK;IACL,KAAK;CACc,CAAC;AAkBf,0DAAuB;AAhBhC,SAAS,eAAe,CACtB,MAAoB,EACpB,QAAQ,GAAG,KAAK,EAChB,uBAA0C;IAE1C,MAAM,aAAa,GAAG;QACpB,GAAG,uBAAuB,EAAU;QACpC,GAAG,CAAC,uBAAuB,IAAI,EAAE,CAAC;KACnC,CAAC;IAGF,MAAM,UAAW,SAAQ,IAAA,kBAAQ,EAAC,MAAM,EAAE,aAAa,CAAC;KAAG;IAE3D,OAAO,QAAQ,CAAC,CAAC,CAAC,IAAA,qBAAW,EAAC,UAAU,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC;AACzD,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.EntityPresenterMixin =
|
|
3
|
+
exports.EntityPresenterMixin = EntityPresenterMixin;
|
|
4
4
|
const swagger_1 = require("@nestjs/swagger");
|
|
5
5
|
const baseEntityKeysToExclude = () => [
|
|
6
6
|
'deletedAt',
|
|
@@ -17,5 +17,4 @@ function EntityPresenterMixin(entity, additionalKeysToExclude) {
|
|
|
17
17
|
}
|
|
18
18
|
return EntityPresenter;
|
|
19
19
|
}
|
|
20
|
-
exports.EntityPresenterMixin = EntityPresenterMixin;
|
|
21
20
|
//# sourceMappingURL=entity-presenter.mixin.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entity-presenter.mixin.js","sourceRoot":"","sources":["../../../libs/dynamic-api/src/mixins/entity-presenter.mixin.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"entity-presenter.mixin.js","sourceRoot":"","sources":["../../../libs/dynamic-api/src/mixins/entity-presenter.mixin.ts"],"names":[],"mappings":";;AA2BS,oDAAoB;AA1B7B,6CAA2C;AAG3C,MAAM,uBAAuB,GAAG,GAA8B,EAAE,CAC9D;IACE,WAAW;IACX,WAAW;IACX,KAAK;IACL,KAAK;CACc,CAAC;AAExB,SAAS,oBAAoB,CAC3B,MAAoB,EACpB,uBAA0C;IAE1C,MAAM,aAAa,GAAG;QACpB,GAAG,uBAAuB,EAAU;QACpC,GAAG,CAAC,uBAAuB,IAAI,EAAE,CAAC;KACnC,CAAC;IAGF,MAAM,eAAgB,SAAQ,IAAA,kBAAQ,EAAC,MAAM,EAAE,aAAa,CAAC;KAAG;IAEhE,OAAO,eAAe,CAAC;AACzB,CAAC"}
|
|
@@ -12,7 +12,8 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
|
12
12
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.
|
|
15
|
+
exports.RoutePoliciesGuardMixin = RoutePoliciesGuardMixin;
|
|
16
|
+
exports.SocketPoliciesGuardMixin = SocketPoliciesGuardMixin;
|
|
16
17
|
const common_1 = require("@nestjs/common");
|
|
17
18
|
const mongoose_1 = require("@nestjs/mongoose");
|
|
18
19
|
const mongoose_2 = require("mongoose");
|
|
@@ -41,7 +42,6 @@ function RoutePoliciesGuardMixin(entity, routeType, displayedName, version, abil
|
|
|
41
42
|
});
|
|
42
43
|
return RoutePoliciesGuard;
|
|
43
44
|
}
|
|
44
|
-
exports.RoutePoliciesGuardMixin = RoutePoliciesGuardMixin;
|
|
45
45
|
function SocketPoliciesGuardMixin(entity, routeType, event, version, abilityPredicate, isPublic, queryToPipeline) {
|
|
46
46
|
let SocketPoliciesGuard = class SocketPoliciesGuard extends guards_1.BaseSocketPoliciesGuard {
|
|
47
47
|
constructor(model) {
|
|
@@ -65,5 +65,4 @@ function SocketPoliciesGuardMixin(entity, routeType, event, version, abilityPred
|
|
|
65
65
|
});
|
|
66
66
|
return SocketPoliciesGuard;
|
|
67
67
|
}
|
|
68
|
-
exports.SocketPoliciesGuardMixin = SocketPoliciesGuardMixin;
|
|
69
68
|
//# sourceMappingURL=policies-guard.mixin.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"policies-guard.mixin.js","sourceRoot":"","sources":["../../../libs/dynamic-api/src/mixins/policies-guard.mixin.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"policies-guard.mixin.js","sourceRoot":"","sources":["../../../libs/dynamic-api/src/mixins/policies-guard.mixin.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAqFS,0DAAuB;AAAE,4DAAwB;AArF1D,2CAAkD;AAClD,+CAA+C;AAE/C,uCAAiC;AACjC,8DAAyD;AACzD,sCAAuE;AACvE,wCAAqD;AASrD,SAAS,uBAAuB,CAC9B,MAAoB,EACpB,SAAoB,EACpB,aAAqB,EACrB,OAA2B,EAC3B,gBAAsD,EACtD,eAAqD;IAErD,IACM,kBAAkB,GADxB,MACM,kBAAmB,SAAQ,0BAAyB;QAMxD,YAKE,KAAuC;YAEvC,KAAK,CAAC,KAAK,CAAC,CAAC;YAFM,UAAK,GAAL,KAAK,CAAe;YAV/B,cAAS,GAAG,SAAS,CAAC;YACtB,WAAM,G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AE;QACjD,KAAK,EAAE,GAAG,IAAA,qBAAW,EAAC,SAAS,EAAE,IAAA,oBAAU,EAAC,KAAK,CAAC,EAAE,OAAO,EAAE,qBAAqB,CAAC,EAAE;QACrF,QAAQ,EAAE,KAAK;KAChB,CAAC,CAAC;IAEH,OAAO,mBAAmB,CAAC;AAC7B,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 { ObjectId } from 'mongoose';
|
|
27
2
|
export declare abstract class BaseEntity {
|
|
28
3
|
_id: ObjectId;
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { Type, ValidationPipeOptions } from '@nestjs/common';
|
|
2
|
-
import { AuthAbilityPredicate,
|
|
2
|
+
import { AuthAbilityPredicate, DynamicApiServiceCallback, DynamicAPIServiceProvider, GatewayOptions } from '../../interfaces';
|
|
3
3
|
import { BaseEntity } from '../../models';
|
|
4
|
-
import { AuthControllerConstructor, AuthGatewayConstructor, DynamicApiLoginOptions, DynamicApiRegisterOptions, DynamicApiResetPasswordOptions, DynamicApiUpdateAccountOptions } from './interfaces';
|
|
4
|
+
import { AuthControllerConstructor, AuthGatewayConstructor, DynamicApiGetAccountOptions, DynamicApiLoginOptions, DynamicApiRegisterOptions, DynamicApiResetPasswordOptions, DynamicApiUpdateAccountOptions } from './interfaces';
|
|
5
5
|
declare const authServiceProviderName = "DynamicApiAuthService";
|
|
6
6
|
declare const authGatewayProviderName = "DynamicApiAuthGateway";
|
|
7
7
|
declare const localStrategyProviderName = "DynamicApiLocalStrategy";
|
|
8
8
|
declare function createLocalStrategyProvider<Entity extends BaseEntity>(loginField: keyof Entity, passwordField: keyof Entity, abilityPredicate: AuthAbilityPredicate | undefined): DynamicAPIServiceProvider;
|
|
9
|
-
declare function createAuthServiceProvider<Entity extends BaseEntity>(userEntity: Type<Entity>, { loginField, passwordField, additionalFields, callback: loginCallback }: DynamicApiLoginOptions<Entity>,
|
|
10
|
-
declare function createAuthController<Entity extends BaseEntity>(userEntity: Type<Entity>, loginOptions: DynamicApiLoginOptions<Entity>, registerOptions: DynamicApiRegisterOptions<Entity> | undefined, validationPipeOptions: ValidationPipeOptions | undefined, resetPasswordOptions: DynamicApiResetPasswordOptions<Entity> | undefined, updateAccountOptions: DynamicApiUpdateAccountOptions<Entity> | undefined): AuthControllerConstructor<Entity>;
|
|
11
|
-
declare function createAuthGateway<Entity extends BaseEntity>(userEntity: Type<Entity>, loginOptions: DynamicApiLoginOptions<Entity>,
|
|
9
|
+
declare function createAuthServiceProvider<Entity extends BaseEntity>(userEntity: Type<Entity>, { loginField, passwordField, additionalFields, callback: loginCallback }: DynamicApiLoginOptions<Entity>, getAccountCallback: DynamicApiServiceCallback<Entity> | undefined, register: DynamicApiRegisterOptions<Entity> | undefined, resetPasswordOptions: DynamicApiResetPasswordOptions<Entity> | undefined, updateAccount: DynamicApiUpdateAccountOptions<Entity> | undefined): DynamicAPIServiceProvider;
|
|
10
|
+
declare function createAuthController<Entity extends BaseEntity>(userEntity: Type<Entity>, loginOptions: DynamicApiLoginOptions<Entity>, getAccountOptions: DynamicApiGetAccountOptions<Entity> | undefined, registerOptions: DynamicApiRegisterOptions<Entity> | undefined, validationPipeOptions: ValidationPipeOptions | undefined, resetPasswordOptions: DynamicApiResetPasswordOptions<Entity> | undefined, updateAccountOptions: DynamicApiUpdateAccountOptions<Entity> | undefined): AuthControllerConstructor<Entity>;
|
|
11
|
+
declare function createAuthGateway<Entity extends BaseEntity>(userEntity: Type<Entity>, loginOptions: DynamicApiLoginOptions<Entity>, getAccountOptions: DynamicApiGetAccountOptions<Entity> | undefined, registerOptions: DynamicApiRegisterOptions<Entity> | undefined, resetPasswordOptions: DynamicApiResetPasswordOptions<Entity> | undefined, updateAccountOptions: DynamicApiUpdateAccountOptions<Entity> | undefined, { validationPipeOptions, ...gatewayOptions }: GatewayOptions & {
|
|
12
|
+
validationPipeOptions?: ValidationPipeOptions;
|
|
13
|
+
}): AuthGatewayConstructor<Entity>;
|
|
12
14
|
export { authServiceProviderName, authGatewayProviderName, createAuthController, createAuthServiceProvider, createAuthGateway, createLocalStrategyProvider, localStrategyProviderName, };
|
|
@@ -12,7 +12,11 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
|
12
12
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.localStrategyProviderName = exports.
|
|
15
|
+
exports.localStrategyProviderName = exports.authGatewayProviderName = exports.authServiceProviderName = void 0;
|
|
16
|
+
exports.createAuthController = createAuthController;
|
|
17
|
+
exports.createAuthServiceProvider = createAuthServiceProvider;
|
|
18
|
+
exports.createAuthGateway = createAuthGateway;
|
|
19
|
+
exports.createLocalStrategyProvider = createLocalStrategyProvider;
|
|
16
20
|
const common_1 = require("@nestjs/common");
|
|
17
21
|
const jwt_1 = require("@nestjs/jwt");
|
|
18
22
|
const mongoose_1 = require("@nestjs/mongoose");
|
|
@@ -64,8 +68,7 @@ function createLocalStrategyProvider(loginField, passwordField, abilityPredicate
|
|
|
64
68
|
useClass: LocalStrategy,
|
|
65
69
|
};
|
|
66
70
|
}
|
|
67
|
-
|
|
68
|
-
function createAuthServiceProvider(userEntity, { loginField, passwordField, additionalFields = [], callback: loginCallback }, registerCallback, resetPasswordOptions, updateAccountCallback, beforeRegisterCallback, beforeUpdateAccountCallback) {
|
|
71
|
+
function createAuthServiceProvider(userEntity, { loginField, passwordField, additionalFields = [], callback: loginCallback }, getAccountCallback, register, resetPasswordOptions, updateAccount) {
|
|
69
72
|
let AuthService = class AuthService extends services_2.BaseAuthService {
|
|
70
73
|
constructor(model, jwtService, bcryptService) {
|
|
71
74
|
super(model, jwtService, bcryptService);
|
|
@@ -76,11 +79,12 @@ function createAuthServiceProvider(userEntity, { loginField, passwordField, addi
|
|
|
76
79
|
this.additionalRequestFields = additionalFields;
|
|
77
80
|
this.loginField = loginField;
|
|
78
81
|
this.passwordField = passwordField;
|
|
79
|
-
this.beforeRegisterCallback =
|
|
80
|
-
this.registerCallback =
|
|
81
|
-
this.beforeUpdateAccountCallback =
|
|
82
|
-
this.updateAccountCallback =
|
|
82
|
+
this.beforeRegisterCallback = register?.beforeSaveCallback;
|
|
83
|
+
this.registerCallback = register?.callback;
|
|
84
|
+
this.beforeUpdateAccountCallback = updateAccount?.beforeSaveCallback;
|
|
85
|
+
this.updateAccountCallback = updateAccount?.callback;
|
|
83
86
|
this.loginCallback = loginCallback;
|
|
87
|
+
this.getAccountCallback = getAccountCallback;
|
|
84
88
|
this.resetPasswordOptions = resetPasswordOptions;
|
|
85
89
|
}
|
|
86
90
|
};
|
|
@@ -95,9 +99,8 @@ function createAuthServiceProvider(userEntity, { loginField, passwordField, addi
|
|
|
95
99
|
useClass: AuthService,
|
|
96
100
|
};
|
|
97
101
|
}
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
let AuthController = class AuthController extends (0, mixins_1.AuthControllerMixin)(userEntity, loginOptions, registerOptions, resetPasswordOptions, updateAccountOptions) {
|
|
102
|
+
function createAuthController(userEntity, loginOptions, getAccountOptions, registerOptions, validationPipeOptions, resetPasswordOptions, updateAccountOptions) {
|
|
103
|
+
let AuthController = class AuthController extends (0, mixins_1.AuthControllerMixin)(userEntity, loginOptions, registerOptions, resetPasswordOptions, updateAccountOptions, getAccountOptions) {
|
|
101
104
|
constructor(service) {
|
|
102
105
|
super(service);
|
|
103
106
|
this.service = service;
|
|
@@ -112,9 +115,8 @@ function createAuthController(userEntity, loginOptions, registerOptions, validat
|
|
|
112
115
|
], AuthController);
|
|
113
116
|
return AuthController;
|
|
114
117
|
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
let AuthGateway = class AuthGateway extends (0, mixins_1.AuthGatewayMixin)(userEntity, loginOptions, registerOptions ?? {}, resetPasswordOptions, updateAccountOptions) {
|
|
118
|
+
function createAuthGateway(userEntity, loginOptions, getAccountOptions, registerOptions, resetPasswordOptions, updateAccountOptions, { validationPipeOptions, ...gatewayOptions }) {
|
|
119
|
+
let AuthGateway = class AuthGateway extends (0, mixins_1.AuthGatewayMixin)(userEntity, loginOptions, registerOptions ?? {}, resetPasswordOptions, updateAccountOptions, getAccountOptions) {
|
|
118
120
|
constructor(service, jwtService) {
|
|
119
121
|
super(service, jwtService);
|
|
120
122
|
this.service = service;
|
|
@@ -130,5 +132,4 @@ function createAuthGateway(userEntity, loginOptions, registerOptions, validation
|
|
|
130
132
|
], AuthGateway);
|
|
131
133
|
return AuthGateway;
|
|
132
134
|
}
|
|
133
|
-
exports.createAuthGateway = createAuthGateway;
|
|
134
135
|
//# sourceMappingURL=auth.helper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.helper.js","sourceRoot":"","sources":["../../../../libs/dynamic-api/src/modules/auth/auth.helper.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"auth.helper.js","sourceRoot":"","sources":["../../../../libs/dynamic-api/src/modules/auth/auth.helper.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAyKE,oDAAoB;AACpB,8DAAyB;AACzB,8CAAiB;AACjB,kEAA2B;AA5K7B,2CAAoJ;AACpJ,qCAAyC;AACzC,+CAA+C;AAC/C,+CAAoD;AACpD,6CAA0C;AAC1C,mDAAsD;AACtD,uCAAiC;AACjC,mDAA0C;AAC1C,iDAAiD;AACjD,iEAA4D;AAC5D,2CAA4D;AAG5D,6CAA+C;AAE/C,qCAAiE;AACjE,yCAA6C;AAE7C,MAAM,uBAAuB,GAAG,uBAAuB,CAAC;AAqJtD,0DAAuB;AApJzB,MAAM,uBAAuB,GAAG,uBAAuB,CAAC;AAqJtD,0DAAuB;AApJzB,MAAM,yBAAyB,GAAG,yBAAyB,CAAC;AAyJ1D,8DAAyB;AAvJ3B,SAAS,2BAA2B,CAClC,UAAwB,EACxB,aAA2B,EAC3B,gBAAkD;IAElD,IACM,aAAa,GADnB,MACM,aAAyC,SAAQ,IAAA,2BAAgB,EAAC,yBAAQ,CAAC;QAG/E,YAEE,WAAmD;YAEnD,KAAK,CAAC;gBACJ,aAAa,EAAE,UAAoB;gBACnC,aAAa,EAAE,aAAuB;aACvC,CAAC,CAAC;YALgB,gBAAW,GAAX,WAAW,CAAqB;YAJ3C,qBAAgB,GAAG,gBAAgB,CAAC;QAU9C,CAAC;QAED,KAAK,CAAC,QAAQ,CAAC,KAAa,EAAE,IAAY;YACxC,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,KAAK,EAAE,IAA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,MAGM,WAAY,SAAQ,IAAA,yBAAgB,EACxC,UAAU,EACV,YAAY,EACZ,eAAe,IAAI,EAAE,EACrB,oBAAoB,EACpB,oBAAoB,EACpB,iBAAiB,CAClB;QACC,YAEqB,OAA4B,EAC5B,UAAsB;YAEzC,KAAK,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;YAHR,YAAO,GAAP,OAAO,CAAqB;YAC5B,eAAU,GAAV,UAAU,CAAY;QAG3C,CAAC;KACF,CAAA;IAfK,WAAW;QAHhB,IAAA,6BAAgB,EAAC,cAAc,CAAC;QAChC,IAAA,mBAAU,EAAC,IAAI,qCAA2B,EAAE,CAAC;QAC7C,IAAA,0BAAa,EAAC,qBAAqB,CAAC;QAUhC,WAAA,IAAA,eAAM,EAAC,uBAAuB,CAAC,CAAA;iDAED,gBAAU;OAXvC,WAAW,CAehB;IAED,OAAO,WAAW,CAAC;AACrB,CAAC"}
|
|
@@ -4,7 +4,7 @@ export declare class AuthModule {
|
|
|
4
4
|
static forRoot<Entity extends BaseEntity>(options: DynamicApiAuthOptions<Entity>): {
|
|
5
5
|
module: typeof AuthModule;
|
|
6
6
|
imports: (import("@nestjs/common").Type<any> | import("@nestjs/common").ForwardReference<any> | import("@nestjs/common").DynamicModule | Promise<import("@nestjs/common").DynamicModule>)[];
|
|
7
|
-
providers: (import("
|
|
7
|
+
providers: (import("../..").DynamicAPIServiceProvider | import("@nestjs/common").Provider)[];
|
|
8
8
|
controllers: import("@nestjs/common").Type<any>[];
|
|
9
9
|
};
|
|
10
10
|
private static initializeAuthOptions;
|
|
@@ -19,13 +19,13 @@ const auth_helper_1 = require("./auth.helper");
|
|
|
19
19
|
const strategies_1 = require("./strategies");
|
|
20
20
|
let AuthModule = AuthModule_1 = class AuthModule {
|
|
21
21
|
static forRoot(options) {
|
|
22
|
-
const { userEntity, login: { loginField, passwordField, ...login }, register, updateAccount, resetPassword, jwt: { secret, expiresIn }, validationPipeOptions, webSocket, extraImports, extraProviders, extraControllers, } = this.initializeAuthOptions(options);
|
|
22
|
+
const { userEntity, login: { loginField, passwordField, ...login }, getAccount, register, updateAccount, resetPassword, jwt: { secret, expiresIn }, validationPipeOptions, webSocket, extraImports, extraProviders, extraControllers, } = this.initializeAuthOptions(options);
|
|
23
23
|
const { resetPasswordCallback, ...resetPasswordOptionsRest } = resetPassword;
|
|
24
24
|
const resetPasswordOptions = resetPasswordCallback
|
|
25
25
|
? { resetPasswordCallback, ...resetPasswordOptionsRest }
|
|
26
26
|
: undefined;
|
|
27
|
-
const AuthController = (0, auth_helper_1.createAuthController)(userEntity, { loginField, passwordField, ...login }, register, validationPipeOptions, resetPasswordOptions, updateAccount);
|
|
28
|
-
const AuthServiceProvider = (0, auth_helper_1.createAuthServiceProvider)(userEntity, { loginField, passwordField, ...login },
|
|
27
|
+
const AuthController = (0, auth_helper_1.createAuthController)(userEntity, { loginField, passwordField, ...login }, getAccount, register, validationPipeOptions, resetPasswordOptions, updateAccount);
|
|
28
|
+
const AuthServiceProvider = (0, auth_helper_1.createAuthServiceProvider)(userEntity, { loginField, passwordField, ...login }, getAccount?.callback, register, resetPasswordOptions, updateAccount);
|
|
29
29
|
const LocalStrategyProvider = (0, auth_helper_1.createLocalStrategyProvider)(loginField, passwordField, login.abilityPredicate);
|
|
30
30
|
const schema = (0, helpers_1.buildSchemaFromEntity)(userEntity);
|
|
31
31
|
services_1.DynamicApiGlobalStateService.addEntitySchema(userEntity, schema);
|
|
@@ -37,7 +37,7 @@ let AuthModule = AuthModule_1 = class AuthModule {
|
|
|
37
37
|
loginField,
|
|
38
38
|
passwordField,
|
|
39
39
|
...login,
|
|
40
|
-
},
|
|
40
|
+
}, getAccount, register, resetPasswordOptions, updateAccount, { ...gatewayOptions, validationPipeOptions }),
|
|
41
41
|
},
|
|
42
42
|
];
|
|
43
43
|
return {
|
|
@@ -54,7 +54,7 @@ let AuthModule = AuthModule_1 = class AuthModule {
|
|
|
54
54
|
jwt_1.JwtModule.register({
|
|
55
55
|
global: true,
|
|
56
56
|
secret,
|
|
57
|
-
signOptions: { expiresIn },
|
|
57
|
+
signOptions: { expiresIn: expiresIn },
|
|
58
58
|
}),
|
|
59
59
|
],
|
|
60
60
|
providers: [
|
|
@@ -68,7 +68,7 @@ let AuthModule = AuthModule_1 = class AuthModule {
|
|
|
68
68
|
controllers: [AuthController, ...extraControllers],
|
|
69
69
|
};
|
|
70
70
|
}
|
|
71
|
-
static initializeAuthOptions({ userEntity, jwt, login, register, updateAccount, resetPassword, validationPipeOptions, webSocket, extraImports = [], extraProviders = [], extraControllers = [], }) {
|
|
71
|
+
static initializeAuthOptions({ userEntity, jwt, login, register, updateAccount, getAccount, resetPassword, validationPipeOptions, webSocket, extraImports = [], extraProviders = [], extraControllers = [], }) {
|
|
72
72
|
return {
|
|
73
73
|
userEntity: userEntity,
|
|
74
74
|
jwt: {
|
|
@@ -81,6 +81,10 @@ let AuthModule = AuthModule_1 = class AuthModule {
|
|
|
81
81
|
passwordField: (login?.passwordField ?? 'password'),
|
|
82
82
|
additionalFields: login?.additionalFields ?? [],
|
|
83
83
|
},
|
|
84
|
+
getAccount: {
|
|
85
|
+
...getAccount,
|
|
86
|
+
useInterceptors: getAccount?.useInterceptors ?? [],
|
|
87
|
+
},
|
|
84
88
|
register: {
|
|
85
89
|
...register,
|
|
86
90
|
additionalFields: register?.additionalFields ?? [],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.module.js","sourceRoot":"","sources":["../../../../libs/dynamic-api/src/modules/auth/auth.module.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,2CAAwC;AACxC,qCAAwC;
|
|
1
|
+
{"version":3,"file":"auth.module.js","sourceRoot":"","sources":["../../../../libs/dynamic-api/src/modules/auth/auth.module.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,2CAAwC;AACxC,qCAAwC;AAExC,+CAAkD;AAClD,+CAAkD;AAClD,iEAA4D;AAC5D,2CAAmF;AAEnF,6CAA6E;AAC7E,+CAAyJ;AAEzJ,6C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