itlab-internal-services 2.15.7 → 2.16.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/README.md +1 -187
- package/dist/classes/document-merger.class.js +2 -3
- package/dist/classes/index.d.ts +4 -1
- package/dist/classes/index.js +7 -3
- package/dist/classes/report-category.class.d.ts +55 -0
- package/dist/classes/report-category.class.js +120 -0
- package/dist/classes/schema-builder.class.d.ts +75 -0
- package/dist/classes/schema-builder.class.js +109 -0
- package/dist/classes/task-manager.class.d.ts +71 -0
- package/dist/classes/task-manager.class.js +99 -0
- package/dist/decorators/{account.decorator.d.ts → authenticated-account.decorator.d.ts} +4 -4
- package/dist/decorators/{account.decorator.js → authenticated-account.decorator.js} +8 -10
- package/dist/decorators/index.d.ts +1 -1
- package/dist/decorators/index.js +1 -1
- package/dist/exceptions/authenticated-user-required.exception.d.ts +34 -0
- package/dist/exceptions/authenticated-user-required.exception.js +51 -0
- package/dist/exceptions/bad-body.exception.d.ts +19 -8
- package/dist/exceptions/bad-body.exception.js +26 -10
- package/dist/exceptions/bad-parameter.exception.d.ts +23 -8
- package/dist/exceptions/bad-parameter.exception.js +41 -18
- package/dist/exceptions/duplicate.exception.d.ts +20 -8
- package/dist/exceptions/duplicate.exception.js +27 -10
- package/dist/exceptions/index.d.ts +1 -0
- package/dist/exceptions/index.js +1 -0
- package/dist/functions/add-views-likes-virtuals.function.d.ts +15 -0
- package/dist/functions/add-views-likes-virtuals.function.js +43 -0
- package/dist/functions/create-internal-axios-client.function.js +2 -2
- package/dist/functions/index.d.ts +1 -0
- package/dist/functions/index.js +3 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.js +5 -5
- package/dist/interceptors/attribute-sanitizer.interceptor.d.ts +68 -0
- package/dist/interceptors/attribute-sanitizer.interceptor.js +154 -0
- package/dist/interceptors/index.d.ts +1 -0
- package/dist/interceptors/index.js +17 -0
- package/dist/middleware/http-logging.middleware.d.ts +19 -0
- package/dist/middleware/http-logging.middleware.js +50 -0
- package/dist/middleware/index.d.ts +1 -0
- package/dist/middleware/index.js +17 -0
- package/dist/models/account.model.d.ts +23 -0
- package/dist/models/account.model.js +59 -0
- package/dist/models/index.d.ts +3 -1
- package/dist/models/index.js +7 -3
- package/dist/{modules/search/models → models}/search-document.model.d.ts +1 -1
- package/dist/{modules/search/models → models}/search-document.model.js +1 -1
- package/dist/models/{account-entity.model.d.ts → user.model.d.ts} +8 -21
- package/dist/models/{account-entity.model.js → user.model.js} +11 -25
- package/dist/modules/authentication/authentication-module-options.interface.d.ts +2 -8
- package/dist/modules/authentication/authentication-options.parameter.d.ts +4 -0
- package/dist/modules/authentication/{inject-auth-options.decorator.js → authentication-options.parameter.js} +5 -2
- package/dist/modules/authentication/authentication.module.d.ts +23 -0
- package/dist/modules/authentication/authentication.module.js +24 -1
- package/dist/modules/authentication/guards/index.d.ts +2 -2
- package/dist/modules/authentication/guards/index.js +7 -7
- package/dist/modules/authentication/guards/jwt-auth.guard.d.ts +17 -0
- package/dist/modules/authentication/guards/jwt-auth.guard.js +67 -0
- package/dist/modules/authentication/guards/permissions.guard.d.ts +5 -27
- package/dist/modules/authentication/guards/permissions.guard.js +27 -59
- package/dist/modules/authentication/guards/public.guard.d.ts +7 -13
- package/dist/modules/authentication/guards/public.guard.js +10 -24
- package/dist/modules/authentication/guards/service-auth.guard.d.ts +22 -0
- package/dist/modules/authentication/guards/service-auth.guard.js +65 -0
- package/dist/modules/authentication/index.d.ts +3 -3
- package/dist/modules/authentication/index.js +3 -5
- package/dist/modules/cache/cache-response.interceptor.d.ts +2 -2
- package/dist/modules/cache/cache-response.interceptor.js +2 -2
- package/dist/modules/cache/index.d.ts +1 -0
- package/dist/modules/cache/index.js +1 -0
- package/dist/modules/comment/comment-module-options.interface.d.ts +38 -0
- package/dist/modules/comment/comment.controller.d.ts +24 -30
- package/dist/modules/comment/comment.controller.js +59 -61
- package/dist/modules/comment/comment.module-definition.d.ts +1 -42
- package/dist/modules/comment/comment.module-definition.js +1 -2
- package/dist/modules/comment/comment.module.d.ts +13 -13
- package/dist/modules/comment/comment.module.js +15 -42
- package/dist/modules/comment/comment.service.d.ts +27 -37
- package/dist/modules/comment/comment.service.js +50 -84
- package/dist/modules/comment/index.d.ts +2 -3
- package/dist/modules/comment/index.js +16 -7
- package/dist/modules/database/database.module.js +2 -5
- package/dist/modules/database/index.d.ts +2 -5
- package/dist/modules/database/index.js +17 -9
- package/dist/modules/index.d.ts +2 -6
- package/dist/modules/index.js +2 -6
- package/dist/modules/like/index.d.ts +2 -1
- package/dist/modules/like/index.js +16 -3
- package/dist/modules/like/like-module-options.interface.d.ts +21 -0
- package/dist/modules/like/like.controller.d.ts +45 -37
- package/dist/modules/like/like.controller.js +117 -102
- package/dist/modules/like/like.module-definition.d.ts +1 -17
- package/dist/modules/like/like.module-definition.js +1 -2
- package/dist/modules/like/like.module.d.ts +12 -12
- package/dist/modules/like/like.module.js +14 -37
- package/dist/modules/like/like.service.d.ts +31 -27
- package/dist/modules/like/like.service.js +42 -35
- package/dist/modules/merge/index.d.ts +3 -0
- package/dist/modules/merge/index.js +19 -0
- package/dist/modules/merge/merge-module-options.interface.d.ts +21 -0
- package/dist/modules/merge/merge.controller.d.ts +30 -0
- package/dist/modules/merge/merge.controller.js +76 -0
- package/dist/modules/merge/merge.module.d.ts +18 -0
- package/dist/modules/merge/merge.module.js +41 -0
- package/dist/modules/merge/merge.service.interface.d.ts +17 -0
- package/dist/modules/services/base-http.service.d.ts +83 -0
- package/dist/modules/services/base-http.service.js +124 -0
- package/dist/modules/services/base-urls.d.ts +22 -0
- package/dist/modules/services/base-urls.js +121 -0
- package/dist/modules/services/index.d.ts +4 -0
- package/dist/modules/services/index.js +20 -0
- package/dist/modules/services/providers/accounts.service.d.ts +52 -0
- package/dist/modules/services/providers/accounts.service.js +84 -0
- package/dist/modules/services/providers/books.service.d.ts +29 -0
- package/dist/modules/services/providers/books.service.js +55 -0
- package/dist/modules/services/providers/changelog.service.d.ts +18 -0
- package/dist/modules/services/providers/changelog.service.js +43 -0
- package/dist/modules/services/providers/comments/comments.service-definition.d.ts +1 -0
- package/dist/modules/services/providers/comments/comments.service-definition.js +4 -0
- package/dist/modules/services/providers/comments/comments.service.d.ts +60 -0
- package/dist/modules/services/providers/comments/comments.service.js +139 -0
- package/dist/modules/services/providers/comments/index.d.ts +1 -0
- package/dist/{factories → modules/services/providers/comments}/index.js +1 -1
- package/dist/modules/services/providers/content/content-return-types.d.ts +19 -0
- package/dist/modules/services/providers/content/content-return-types.js +7 -0
- package/dist/modules/services/providers/content/content.service-definition.d.ts +1 -0
- package/dist/modules/services/providers/content/content.service-definition.js +4 -0
- package/dist/modules/services/providers/content/content.service.d.ts +96 -0
- package/dist/modules/services/providers/content/content.service.js +231 -0
- package/dist/modules/services/providers/content/index.d.ts +2 -0
- package/dist/modules/{search/models → services/providers/content}/index.js +1 -1
- package/dist/modules/services/providers/demo-hive.service.d.ts +29 -0
- package/dist/modules/services/providers/demo-hive.service.js +55 -0
- package/dist/modules/services/providers/events.service.d.ts +29 -0
- package/dist/modules/services/providers/events.service.js +55 -0
- package/dist/modules/services/providers/hackschool.service.d.ts +49 -0
- package/dist/modules/services/providers/hackschool.service.js +79 -0
- package/dist/modules/services/providers/ideas.service.d.ts +18 -0
- package/dist/modules/services/providers/ideas.service.js +43 -0
- package/dist/modules/services/providers/index.d.ts +19 -0
- package/dist/modules/services/providers/index.js +35 -0
- package/dist/modules/services/providers/lunch-roulette.service.d.ts +18 -0
- package/dist/modules/services/providers/lunch-roulette.service.js +43 -0
- package/dist/modules/services/providers/mail/index.d.ts +3 -0
- package/dist/modules/services/providers/mail/index.js +19 -0
- package/dist/modules/services/providers/mail/mail-types.d.ts +30 -0
- package/dist/modules/services/providers/mail/mail-types.js +22 -0
- package/dist/modules/services/providers/mail/mail.service.d.ts +99 -0
- package/dist/modules/{mail → services/providers/mail}/mail.service.js +55 -92
- package/dist/modules/services/providers/newletter.service.d.ts +29 -0
- package/dist/modules/services/providers/newletter.service.js +55 -0
- package/dist/modules/services/providers/newsroom.service.d.ts +47 -0
- package/dist/modules/services/providers/newsroom.service.js +73 -0
- package/dist/modules/services/providers/notification/dtos/schedule-notification.dto.js +2 -0
- package/dist/modules/services/providers/notification/index.d.ts +2 -0
- package/dist/modules/services/providers/notification/index.js +18 -0
- package/dist/modules/services/providers/notification/notification.service-definition.d.ts +1 -0
- package/dist/modules/services/providers/notification/notification.service-definition.js +4 -0
- package/dist/modules/services/providers/notification/notification.service.d.ts +50 -0
- package/dist/modules/services/providers/notification/notification.service.js +130 -0
- package/dist/modules/services/providers/pass/dtos/create-guild-member-pass.dto.js +2 -0
- package/dist/modules/services/providers/pass/dtos/create-team-member-pass.dto.js +2 -0
- package/dist/modules/services/providers/pass/index.d.ts +2 -0
- package/dist/modules/services/providers/pass/index.js +18 -0
- package/dist/modules/services/providers/pass/pass-types.d.ts +18 -0
- package/dist/modules/services/providers/pass/pass-types.js +7 -0
- package/dist/modules/{pass → services/providers/pass}/pass.service.d.ts +15 -39
- package/dist/modules/{pass → services/providers/pass}/pass.service.js +46 -61
- package/dist/modules/services/providers/podcasts.service.d.ts +29 -0
- package/dist/modules/services/providers/podcasts.service.js +55 -0
- package/dist/modules/services/providers/search/dtos/index-search-document.dto.js +2 -0
- package/dist/modules/services/providers/search/index.d.ts +2 -0
- package/dist/modules/services/providers/search/index.js +18 -0
- package/dist/modules/services/providers/search/search.service-definition.d.ts +1 -0
- package/dist/modules/services/providers/search/search.service-definition.js +4 -0
- package/dist/modules/services/providers/search/search.service.d.ts +66 -0
- package/dist/modules/services/providers/search/search.service.js +171 -0
- package/dist/modules/services/providers/team.service.d.ts +29 -0
- package/dist/modules/services/providers/team.service.js +55 -0
- package/dist/modules/services/providers/tech-radar.service.d.ts +39 -0
- package/dist/modules/services/providers/tech-radar.service.js +67 -0
- package/dist/modules/services/services-module-options.interface.d.ts +4 -0
- package/dist/modules/services/services-module-options.interface.js +2 -0
- package/dist/modules/services/services-options.parameter.d.ts +1 -0
- package/dist/modules/services/services-options.parameter.js +8 -0
- package/dist/modules/services/services.module-definition.d.ts +16 -0
- package/dist/modules/services/services.module-definition.js +21 -0
- package/dist/modules/services/services.module.d.ts +17 -0
- package/dist/modules/services/services.module.js +63 -0
- package/dist/pipes/index.d.ts +2 -3
- package/dist/pipes/index.js +2 -3
- package/dist/pipes/params/hub-id.pipe.d.ts +22 -0
- package/dist/pipes/{hub-id.pipe.js → params/hub-id.pipe.js} +14 -17
- package/dist/pipes/params/hub-resource.pipe.d.ts +22 -0
- package/dist/pipes/{hub-resource.pipe.js → params/hub-resource.pipe.js} +19 -20
- package/dist/pipes/params/index.d.ts +3 -0
- package/dist/pipes/params/index.js +19 -0
- package/dist/pipes/params/mongo-id.pipe.d.ts +15 -0
- package/dist/pipes/params/mongo-id.pipe.js +52 -0
- package/dist/pipes/queries/index.d.ts +3 -0
- package/dist/pipes/queries/index.js +19 -0
- package/dist/pipes/queries/mongo-ids.pipe.d.ts +22 -0
- package/dist/pipes/queries/mongo-ids.pipe.js +60 -0
- package/dist/pipes/queries/optional-boolean.pipe.d.ts +29 -0
- package/dist/pipes/queries/optional-boolean.pipe.js +72 -0
- package/dist/pipes/queries/optional-include-drafts.pipe.d.ts +28 -0
- package/dist/pipes/queries/optional-include-drafts.pipe.js +38 -0
- package/dist/properties/content-return-type.property.d.ts +7 -0
- package/dist/properties/content-return-type.property.js +22 -0
- package/dist/properties/index.d.ts +4 -0
- package/dist/properties/index.js +11 -0
- package/dist/properties/likeable.properties.d.ts +1 -0
- package/dist/properties/likeable.properties.js +66 -0
- package/dist/properties/viewable.properties.d.ts +1 -0
- package/dist/properties/viewable.properties.js +66 -0
- package/dist/swagger/index.d.ts +1 -0
- package/dist/swagger/index.js +5 -0
- package/dist/swagger/remove-public-route-auth.plugin.d.ts +9 -0
- package/dist/swagger/remove-public-route-auth.plugin.js +25 -0
- package/dist/swagger/swagger-options.interface.d.ts +14 -0
- package/dist/swagger/swagger-options.interface.js +2 -0
- package/dist/swagger/swagger.function.d.ts +11 -0
- package/dist/swagger/swagger.function.js +47 -0
- package/dist/transform/boolean.transform.js +3 -3
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.js +18 -0
- package/dist/types/likeable.type.d.ts +15 -0
- package/dist/types/likeable.type.js +2 -0
- package/dist/types/viewable.type.d.ts +15 -0
- package/dist/types/viewable.type.js +2 -0
- package/package.json +2 -2
- package/dist/classes/document-updater.class.d.ts +0 -39
- package/dist/classes/document-updater.class.js +0 -57
- package/dist/factories/index.d.ts +0 -1
- package/dist/factories/virtuals.factory.d.ts +0 -79
- package/dist/factories/virtuals.factory.js +0 -171
- package/dist/http-logger.middleware.d.ts +0 -12
- package/dist/http-logger.middleware.js +0 -43
- package/dist/likeable.interface.d.ts +0 -41
- package/dist/likeable.interface.js +0 -48
- package/dist/modules/authentication/guards/auth.guard.d.ts +0 -36
- package/dist/modules/authentication/guards/auth.guard.js +0 -107
- package/dist/modules/authentication/guards/internal.guard.d.ts +0 -33
- package/dist/modules/authentication/guards/internal.guard.js +0 -72
- package/dist/modules/authentication/inject-auth-options.decorator.d.ts +0 -1
- package/dist/modules/comment/comment.model.d.ts +0 -29
- package/dist/modules/comment/comment.model.js +0 -43
- package/dist/modules/content/content.module-definition.d.ts +0 -5
- package/dist/modules/content/content.module-definition.js +0 -8
- package/dist/modules/content/content.module.d.ts +0 -31
- package/dist/modules/content/content.module.js +0 -60
- package/dist/modules/content/content.service.d.ts +0 -50
- package/dist/modules/content/content.service.js +0 -145
- package/dist/modules/content/index.d.ts +0 -3
- package/dist/modules/content/index.js +0 -9
- package/dist/modules/database/model-service/dbs/hub-account.db.d.ts +0 -28
- package/dist/modules/database/model-service/dbs/hub-account.db.js +0 -44
- package/dist/modules/database/model-service/dbs/hub-books.db.d.ts +0 -23
- package/dist/modules/database/model-service/dbs/hub-books.db.js +0 -45
- package/dist/modules/database/model-service/dbs/hub-comments.db.d.ts +0 -29
- package/dist/modules/database/model-service/dbs/hub-comments.db.js +0 -68
- package/dist/modules/database/model-service/dbs/hub-content.db.d.ts +0 -24
- package/dist/modules/database/model-service/dbs/hub-content.db.js +0 -49
- package/dist/modules/database/model-service/dbs/hub-demo-hive.db.d.ts +0 -23
- package/dist/modules/database/model-service/dbs/hub-demo-hive.db.js +0 -45
- package/dist/modules/database/model-service/dbs/hub-events.db.d.ts +0 -24
- package/dist/modules/database/model-service/dbs/hub-events.db.js +0 -49
- package/dist/modules/database/model-service/dbs/hub-hackschool.db.d.ts +0 -60
- package/dist/modules/database/model-service/dbs/hub-hackschool.db.js +0 -106
- package/dist/modules/database/model-service/dbs/hub-newsroom.db.d.ts +0 -25
- package/dist/modules/database/model-service/dbs/hub-newsroom.db.js +0 -53
- package/dist/modules/database/model-service/dbs/hub-podcasts.db.d.ts +0 -23
- package/dist/modules/database/model-service/dbs/hub-podcasts.db.js +0 -45
- package/dist/modules/database/model-service/dbs/hub-team.db.d.ts +0 -22
- package/dist/modules/database/model-service/dbs/hub-team.db.js +0 -41
- package/dist/modules/database/model-service/dbs/hub-tech-radar.db.d.ts +0 -42
- package/dist/modules/database/model-service/dbs/hub-tech-radar.db.js +0 -81
- package/dist/modules/database/model-service/model.service.d.ts +0 -6407
- package/dist/modules/database/model-service/model.service.js +0 -136
- package/dist/modules/database/populate-service/populate.service.d.ts +0 -73
- package/dist/modules/database/populate-service/populate.service.js +0 -163
- package/dist/modules/database/service-mapper-service/service-mapper.service.d.ts +0 -32
- package/dist/modules/database/service-mapper-service/service-mapper.service.js +0 -73
- package/dist/modules/fetch/fetch.module.d.ts +0 -31
- package/dist/modules/fetch/fetch.module.js +0 -60
- package/dist/modules/fetch/fetch.service.d.ts +0 -153
- package/dist/modules/fetch/fetch.service.js +0 -274
- package/dist/modules/fetch/index.d.ts +0 -2
- package/dist/modules/fetch/index.js +0 -7
- package/dist/modules/mail/index.d.ts +0 -4
- package/dist/modules/mail/index.js +0 -23
- package/dist/modules/mail/mail.module.d.ts +0 -31
- package/dist/modules/mail/mail.module.js +0 -60
- package/dist/modules/mail/mail.service.d.ts +0 -136
- package/dist/modules/notification/index.d.ts +0 -3
- package/dist/modules/notification/index.js +0 -22
- package/dist/modules/notification/notification.module-definition.d.ts +0 -5
- package/dist/modules/notification/notification.module-definition.js +0 -8
- package/dist/modules/notification/notification.module.d.ts +0 -34
- package/dist/modules/notification/notification.module.js +0 -63
- package/dist/modules/notification/notification.service.d.ts +0 -42
- package/dist/modules/notification/notification.service.js +0 -100
- package/dist/modules/pass/index.d.ts +0 -3
- package/dist/modules/pass/index.js +0 -22
- package/dist/modules/pass/pass.module.d.ts +0 -32
- package/dist/modules/pass/pass.module.js +0 -61
- package/dist/modules/search/index.d.ts +0 -4
- package/dist/modules/search/index.js +0 -23
- package/dist/modules/search/models/index.d.ts +0 -1
- package/dist/modules/search/search.module-definition.d.ts +0 -5
- package/dist/modules/search/search.module-definition.js +0 -8
- package/dist/modules/search/search.module.d.ts +0 -33
- package/dist/modules/search/search.module.js +0 -62
- package/dist/modules/search/search.service.d.ts +0 -49
- package/dist/modules/search/search.service.js +0 -120
- package/dist/pipes/hub-id.pipe.d.ts +0 -22
- package/dist/pipes/hub-resource.pipe.d.ts +0 -22
- package/dist/pipes/mongo-id.pipe.d.ts +0 -14
- package/dist/pipes/mongo-id.pipe.js +0 -52
- package/dist/swagger.config.d.ts +0 -36
- package/dist/swagger.config.js +0 -76
- package/dist/viewable.interface.d.ts +0 -41
- package/dist/viewable.interface.js +0 -48
- /package/dist/modules/{mail/dtos/auth-login-token-mail.dto.js → comment/comment-module-options.interface.js} +0 -0
- /package/dist/modules/{mail/dtos/auth-password-reset-mail.dto.js → like/like-module-options.interface.js} +0 -0
- /package/dist/modules/{mail/dtos/event-cancel-mail.dto.js → merge/merge-module-options.interface.js} +0 -0
- /package/dist/modules/{mail/dtos/event-invite-mail.dto.js → merge/merge.service.interface.js} +0 -0
- /package/dist/modules/{mail → services/providers/mail}/dtos/auth-login-token-mail.dto.d.ts +0 -0
- /package/dist/modules/{mail/dtos/idea-status-updated-mail.dto.js → services/providers/mail/dtos/auth-login-token-mail.dto.js} +0 -0
- /package/dist/modules/{mail → services/providers/mail}/dtos/auth-password-reset-mail.dto.d.ts +0 -0
- /package/dist/modules/{mail/dtos/idea-submitted-mail.dto.js → services/providers/mail/dtos/auth-password-reset-mail.dto.js} +0 -0
- /package/dist/modules/{mail → services/providers/mail}/dtos/event-cancel-mail.dto.d.ts +0 -0
- /package/dist/modules/{mail/dtos/lunch-roulette-cancel-mail.dto.js → services/providers/mail/dtos/event-cancel-mail.dto.js} +0 -0
- /package/dist/modules/{mail → services/providers/mail}/dtos/event-invite-mail.dto.d.ts +0 -0
- /package/dist/modules/{mail/dtos/lunch-roulette-matched-mail.dto.js → services/providers/mail/dtos/event-invite-mail.dto.js} +0 -0
- /package/dist/modules/{mail → services/providers/mail}/dtos/idea-status-updated-mail.dto.d.ts +0 -0
- /package/dist/modules/{mail/dtos/lunch-roulette-submitted-mail.dto.js → services/providers/mail/dtos/idea-status-updated-mail.dto.js} +0 -0
- /package/dist/modules/{mail → services/providers/mail}/dtos/idea-submitted-mail.dto.d.ts +0 -0
- /package/dist/modules/{mail/dtos/lunch-roulette-unmatched-mail.dto.js → services/providers/mail/dtos/idea-submitted-mail.dto.js} +0 -0
- /package/dist/modules/{mail → services/providers/mail}/dtos/index.d.ts +0 -0
- /package/dist/modules/{mail → services/providers/mail}/dtos/index.js +0 -0
- /package/dist/modules/{mail → services/providers/mail}/dtos/lunch-roulette-cancel-mail.dto.d.ts +0 -0
- /package/dist/modules/{mail/dtos/newsletter-issue-mail.dto.js → services/providers/mail/dtos/lunch-roulette-cancel-mail.dto.js} +0 -0
- /package/dist/modules/{mail → services/providers/mail}/dtos/lunch-roulette-matched-mail.dto.d.ts +0 -0
- /package/dist/modules/{mail/dtos/newsletter-subscribed-mail.dto.js → services/providers/mail/dtos/lunch-roulette-matched-mail.dto.js} +0 -0
- /package/dist/modules/{mail → services/providers/mail}/dtos/lunch-roulette-submitted-mail.dto.d.ts +0 -0
- /package/dist/modules/{mail/dtos/newsletter-unsubscribed-mail.dto.js → services/providers/mail/dtos/lunch-roulette-submitted-mail.dto.js} +0 -0
- /package/dist/modules/{mail → services/providers/mail}/dtos/lunch-roulette-unmatched-mail.dto.d.ts +0 -0
- /package/dist/modules/{mail/dtos/notification-mail.dto.js → services/providers/mail/dtos/lunch-roulette-unmatched-mail.dto.js} +0 -0
- /package/dist/modules/{mail → services/providers/mail}/dtos/newsletter-issue-mail.dto.d.ts +0 -0
- /package/dist/modules/{notification/dtos/schedule-notification.dto.js → services/providers/mail/dtos/newsletter-issue-mail.dto.js} +0 -0
- /package/dist/modules/{mail → services/providers/mail}/dtos/newsletter-subscribed-mail.dto.d.ts +0 -0
- /package/dist/modules/{pass/dtos/create-guild-member-pass.dto.js → services/providers/mail/dtos/newsletter-subscribed-mail.dto.js} +0 -0
- /package/dist/modules/{mail → services/providers/mail}/dtos/newsletter-unsubscribed-mail.dto.d.ts +0 -0
- /package/dist/modules/{pass/dtos/create-team-member-pass.dto.js → services/providers/mail/dtos/newsletter-unsubscribed-mail.dto.js} +0 -0
- /package/dist/modules/{mail → services/providers/mail}/dtos/notification-mail.dto.d.ts +0 -0
- /package/dist/modules/{search/dtos/index-search-document.dto.js → services/providers/mail/dtos/notification-mail.dto.js} +0 -0
- /package/dist/modules/{mail → services/providers/mail}/models/index.d.ts +0 -0
- /package/dist/modules/{mail → services/providers/mail}/models/index.js +0 -0
- /package/dist/modules/{mail → services/providers/mail}/models/mail-recipient.model.d.ts +0 -0
- /package/dist/modules/{mail → services/providers/mail}/models/mail-recipient.model.js +0 -0
- /package/dist/modules/{notification → services/providers/notification}/dtos/index.d.ts +0 -0
- /package/dist/modules/{notification → services/providers/notification}/dtos/index.js +0 -0
- /package/dist/modules/{notification → services/providers/notification}/dtos/schedule-notification.dto.d.ts +0 -0
- /package/dist/modules/{pass → services/providers/pass}/dtos/create-guild-member-pass.dto.d.ts +0 -0
- /package/dist/modules/{pass → services/providers/pass}/dtos/create-team-member-pass.dto.d.ts +0 -0
- /package/dist/modules/{pass → services/providers/pass}/dtos/index.d.ts +0 -0
- /package/dist/modules/{pass → services/providers/pass}/dtos/index.js +0 -0
- /package/dist/modules/{search → services/providers/search}/dtos/index-search-document.dto.d.ts +0 -0
- /package/dist/modules/{search → services/providers/search}/dtos/index.d.ts +0 -0
- /package/dist/modules/{search → services/providers/search}/dtos/index.js +0 -0
- /package/dist/{modules/content → properties}/content.property.d.ts +0 -0
- /package/dist/{modules/content → properties}/content.property.js +0 -0
|
@@ -0,0 +1,73 @@
|
|
|
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.NewsroomService = void 0;
|
|
16
|
+
const common_1 = require("@nestjs/common");
|
|
17
|
+
const config_1 = require("@nestjs/config");
|
|
18
|
+
const class_validator_1 = require("class-validator");
|
|
19
|
+
const authentication_1 = require("../../authentication");
|
|
20
|
+
const base_http_service_1 = require("../base-http.service");
|
|
21
|
+
const base_urls_1 = require("../base-urls");
|
|
22
|
+
/**
|
|
23
|
+
* NewsroomService
|
|
24
|
+
*
|
|
25
|
+
* Service client for interacting with the Newsroom domain.
|
|
26
|
+
* Inherits logging, authentication, and environment-sensitive URL resolution from `BaseHttpService`.
|
|
27
|
+
*/
|
|
28
|
+
let NewsroomService = class NewsroomService extends base_http_service_1.BaseHttpService {
|
|
29
|
+
/**
|
|
30
|
+
* NewsroomService
|
|
31
|
+
*
|
|
32
|
+
* Service client for interacting with the Newsroom domain.
|
|
33
|
+
* Inherits logging, authentication, and environment-sensitive URL resolution from `BaseHttpService`.
|
|
34
|
+
*/
|
|
35
|
+
constructor(authenticationOptions, configService) {
|
|
36
|
+
super('Newsroom', base_urls_1.BaseUrls.NewsroomService, authenticationOptions, configService);
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Retrieves a single news entry by its MongoDB identifier.
|
|
40
|
+
*
|
|
41
|
+
* If the downstream call fails or the resource does not exist, the method
|
|
42
|
+
* will log the failure and return `undefined`.
|
|
43
|
+
*
|
|
44
|
+
* @param {string} newsId - Unique MongoDB identifier of the news item.
|
|
45
|
+
* @param options - Optional flags controlling retrieval behavior.
|
|
46
|
+
* @returns {Promise<LabNews | undefined>} Resolves to the news object if found, otherwise `undefined`.
|
|
47
|
+
*/
|
|
48
|
+
async fetchNewsById(newsId, options = {}) {
|
|
49
|
+
if (!(0, class_validator_1.isMongoId)(newsId))
|
|
50
|
+
return undefined;
|
|
51
|
+
return this.fetchResource(`internal/news/${newsId}`, { params: { options } });
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Retrieves a collection of news entries by their MongoDB identifiers.
|
|
55
|
+
*
|
|
56
|
+
* If the downstream call fails, an empty array is returned.
|
|
57
|
+
*
|
|
58
|
+
* @param {string[]} newsIds - Array of MongoDB identifiers for the news items.
|
|
59
|
+
* @param options - Optional flags controlling retrieval behavior.
|
|
60
|
+
* @returns {Promise<LabNews[]>} Resolves to an array of news objects (empty if none found).
|
|
61
|
+
*/
|
|
62
|
+
async getNewsCollection(newsIds, options = {}) {
|
|
63
|
+
if (newsIds.length === 0)
|
|
64
|
+
return [];
|
|
65
|
+
return this.fetchResourceCollection(`internal/news`, { params: Object.assign(Object.assign({}, options), { ids: newsIds }) });
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
exports.NewsroomService = NewsroomService;
|
|
69
|
+
exports.NewsroomService = NewsroomService = __decorate([
|
|
70
|
+
(0, common_1.Injectable)(),
|
|
71
|
+
__param(0, (0, authentication_1.InjectAuthenticationOptions)()),
|
|
72
|
+
__metadata("design:paramtypes", [Object, config_1.ConfigService])
|
|
73
|
+
], NewsroomService);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./dtos"), exports);
|
|
18
|
+
__exportStar(require("./notification.service"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const FEATURE_NOTIFICATION_SERVICE_TOKEN: unique symbol;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { DynamicModule } from '@nestjs/common';
|
|
2
|
+
import { ConfigService } from '@nestjs/config';
|
|
3
|
+
import { HubResource } from '../../../../hub-resource.enum';
|
|
4
|
+
import { AuthenticationModuleOptions } from '../../../authentication';
|
|
5
|
+
import { BaseHttpService } from '../../base-http.service';
|
|
6
|
+
import { ServicesModuleOptions } from '../../services-module-options.interface';
|
|
7
|
+
import { ScheduleNotificationDto } from './dtos';
|
|
8
|
+
/**
|
|
9
|
+
* Parameter decorator to inject the feature-specific NotificationService.
|
|
10
|
+
*/
|
|
11
|
+
export declare function InjectFeatureNotificationService(): ParameterDecorator;
|
|
12
|
+
/**
|
|
13
|
+
* NotificationService
|
|
14
|
+
*
|
|
15
|
+
* Provides methods to schedule and unschedule notifications for specific resources.
|
|
16
|
+
* Communicates with the organisation-hub notification microservice.
|
|
17
|
+
*/
|
|
18
|
+
export declare class NotificationService extends BaseHttpService {
|
|
19
|
+
readonly options: ServicesModuleOptions;
|
|
20
|
+
/**
|
|
21
|
+
* Creates a NotificationService client for a specific resource.
|
|
22
|
+
*
|
|
23
|
+
* @param authenticationOptions Authentication options injected from the Auth module.
|
|
24
|
+
* @param options Options specifying the resource type this service operates on.
|
|
25
|
+
* @param configService NestJS configuration service for environment variables and URLs.
|
|
26
|
+
*/
|
|
27
|
+
constructor(authenticationOptions: AuthenticationModuleOptions, options: ServicesModuleOptions, configService: ConfigService);
|
|
28
|
+
/**
|
|
29
|
+
* Factory method to create a dynamic module for a specific Hub resource.
|
|
30
|
+
*
|
|
31
|
+
* @param resource The HubResource type this module will provide notification services for.
|
|
32
|
+
* @returns A DynamicModule with a provider for the specified NotificationService instance.
|
|
33
|
+
*/
|
|
34
|
+
static forResource(resource: HubResource): DynamicModule;
|
|
35
|
+
/**
|
|
36
|
+
* Schedules or reschedules a notification for a given resource.
|
|
37
|
+
* Updates existing notifications if necessary.
|
|
38
|
+
*
|
|
39
|
+
* @param resourceId Unique identifier of the resource.
|
|
40
|
+
* @param notification Notification configuration payload.
|
|
41
|
+
*/
|
|
42
|
+
scheduleNotification(resourceId: string, notification: ScheduleNotificationDto): void;
|
|
43
|
+
/**
|
|
44
|
+
* Unschedules a previously set notification for a given resource.
|
|
45
|
+
* Typically called when the resource is deleted or the event is canceled.
|
|
46
|
+
*
|
|
47
|
+
* @param resourceId Unique identifier of the resource.
|
|
48
|
+
*/
|
|
49
|
+
unscheduleNotification(resourceId: string): void;
|
|
50
|
+
}
|
|
@@ -0,0 +1,130 @@
|
|
|
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
|
+
var NotificationService_1;
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.NotificationService = void 0;
|
|
17
|
+
exports.InjectFeatureNotificationService = InjectFeatureNotificationService;
|
|
18
|
+
const common_1 = require("@nestjs/common");
|
|
19
|
+
const config_1 = require("@nestjs/config");
|
|
20
|
+
const authentication_1 = require("../../../authentication");
|
|
21
|
+
const authentication_module_definition_1 = require("../../../authentication/authentication.module-definition");
|
|
22
|
+
const base_http_service_1 = require("../../base-http.service");
|
|
23
|
+
const base_urls_1 = require("../../base-urls");
|
|
24
|
+
const services_options_parameter_1 = require("../../services-options.parameter");
|
|
25
|
+
const notification_service_definition_1 = require("./notification.service-definition");
|
|
26
|
+
/**
|
|
27
|
+
* Parameter decorator to inject the feature-specific NotificationService.
|
|
28
|
+
*/
|
|
29
|
+
function InjectFeatureNotificationService() {
|
|
30
|
+
return (0, common_1.Inject)(notification_service_definition_1.FEATURE_NOTIFICATION_SERVICE_TOKEN);
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* NotificationService
|
|
34
|
+
*
|
|
35
|
+
* Provides methods to schedule and unschedule notifications for specific resources.
|
|
36
|
+
* Communicates with the organisation-hub notification microservice.
|
|
37
|
+
*/
|
|
38
|
+
let NotificationService = NotificationService_1 = class NotificationService extends base_http_service_1.BaseHttpService {
|
|
39
|
+
/**
|
|
40
|
+
* Creates a NotificationService client for a specific resource.
|
|
41
|
+
*
|
|
42
|
+
* @param authenticationOptions Authentication options injected from the Auth module.
|
|
43
|
+
* @param options Options specifying the resource type this service operates on.
|
|
44
|
+
* @param configService NestJS configuration service for environment variables and URLs.
|
|
45
|
+
*/
|
|
46
|
+
constructor(authenticationOptions, options, configService) {
|
|
47
|
+
super('Notification', base_urls_1.BaseUrls.NotificationService, authenticationOptions, configService);
|
|
48
|
+
this.options = options;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Factory method to create a dynamic module for a specific Hub resource.
|
|
52
|
+
*
|
|
53
|
+
* @param resource The HubResource type this module will provide notification services for.
|
|
54
|
+
* @returns A DynamicModule with a provider for the specified NotificationService instance.
|
|
55
|
+
*/
|
|
56
|
+
static forResource(resource) {
|
|
57
|
+
let SearchModule = class SearchModule {
|
|
58
|
+
};
|
|
59
|
+
SearchModule = __decorate([
|
|
60
|
+
(0, common_1.Module)({})
|
|
61
|
+
], SearchModule);
|
|
62
|
+
return {
|
|
63
|
+
module: SearchModule,
|
|
64
|
+
exports: [notification_service_definition_1.FEATURE_NOTIFICATION_SERVICE_TOKEN],
|
|
65
|
+
providers: [
|
|
66
|
+
{
|
|
67
|
+
provide: notification_service_definition_1.FEATURE_NOTIFICATION_SERVICE_TOKEN,
|
|
68
|
+
inject: [authentication_module_definition_1.AUTHENTICATION_MODULE_OPTIONS_TOKEN, config_1.ConfigService],
|
|
69
|
+
useFactory: (authenticationOptions, configService) => {
|
|
70
|
+
return new NotificationService_1(authenticationOptions, { resource }, configService);
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
],
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Schedules or reschedules a notification for a given resource.
|
|
78
|
+
* Updates existing notifications if necessary.
|
|
79
|
+
*
|
|
80
|
+
* @param resourceId Unique identifier of the resource.
|
|
81
|
+
* @param notification Notification configuration payload.
|
|
82
|
+
*/
|
|
83
|
+
scheduleNotification(resourceId, notification) {
|
|
84
|
+
if (!this.options.resource) {
|
|
85
|
+
this.logger.error('Cannot schedule notification: Resource type not provided.');
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
const endpoint = `internal/${this.options.resource}/${resourceId}`;
|
|
89
|
+
this.logger.log(`Scheduling notification for ${this.options.resource} ${resourceId}...`);
|
|
90
|
+
this.client
|
|
91
|
+
.post(endpoint, notification)
|
|
92
|
+
.then(() => {
|
|
93
|
+
this.logger.log(`Successfully scheduled notification for ${this.options.resource} ${resourceId}.`);
|
|
94
|
+
})
|
|
95
|
+
.catch((error) => {
|
|
96
|
+
const { message } = this.parseError(error);
|
|
97
|
+
this.logger.error(`Failed to schedule notification for ${this.options.resource} ${resourceId}: ${message}`);
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Unschedules a previously set notification for a given resource.
|
|
102
|
+
* Typically called when the resource is deleted or the event is canceled.
|
|
103
|
+
*
|
|
104
|
+
* @param resourceId Unique identifier of the resource.
|
|
105
|
+
*/
|
|
106
|
+
unscheduleNotification(resourceId) {
|
|
107
|
+
if (!this.options.resource) {
|
|
108
|
+
this.logger.error('Cannot unschedule notification: Resource type not provided.');
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
const endpoint = `internal${this.options.resource}/${resourceId}`;
|
|
112
|
+
this.logger.log(`Unscheduling notification for ${this.options.resource} (${resourceId})`);
|
|
113
|
+
this.client
|
|
114
|
+
.delete(endpoint)
|
|
115
|
+
.then(() => {
|
|
116
|
+
this.logger.log(`Successfully unscheduled notification for ${this.options.resource} ${resourceId}`);
|
|
117
|
+
})
|
|
118
|
+
.catch((error) => {
|
|
119
|
+
const { message } = this.parseError(error);
|
|
120
|
+
this.logger.error(`Failed to unschedule notification for ${this.options.resource} ${resourceId}: ${message}`);
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
exports.NotificationService = NotificationService;
|
|
125
|
+
exports.NotificationService = NotificationService = NotificationService_1 = __decorate([
|
|
126
|
+
(0, common_1.Injectable)(),
|
|
127
|
+
__param(0, (0, authentication_1.InjectAuthenticationOptions)()),
|
|
128
|
+
__param(1, (0, services_options_parameter_1.InjectServicesOptions)()),
|
|
129
|
+
__metadata("design:paramtypes", [Object, Object, config_1.ConfigService])
|
|
130
|
+
], NotificationService);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./dtos"), exports);
|
|
18
|
+
__exportStar(require("./pass.service"), exports);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { CreateGuildMemberPassDto, CreateTeamMemberPassDto } from './dtos';
|
|
2
|
+
/**
|
|
3
|
+
* Constant list of supported digital pass types.
|
|
4
|
+
*/
|
|
5
|
+
declare const supportedPassTypes: readonly ["team-member", "guild-member"];
|
|
6
|
+
/**
|
|
7
|
+
* Union type representing valid pass types.
|
|
8
|
+
*/
|
|
9
|
+
export type PassType = (typeof supportedPassTypes)[number];
|
|
10
|
+
/**
|
|
11
|
+
* Maps each supported pass type to its corresponding DTO.
|
|
12
|
+
* This enables type-safe payload handling when creating passes.
|
|
13
|
+
*/
|
|
14
|
+
export type PassTypeDtoMap = {
|
|
15
|
+
'team-member': CreateTeamMemberPassDto;
|
|
16
|
+
'guild-member': CreateGuildMemberPassDto;
|
|
17
|
+
};
|
|
18
|
+
export {};
|
|
@@ -1,68 +1,46 @@
|
|
|
1
1
|
import { ConfigService } from '@nestjs/config';
|
|
2
|
-
import { AuthenticationModuleOptions } from '
|
|
2
|
+
import { AuthenticationModuleOptions } from '../../../authentication';
|
|
3
|
+
import { BaseHttpService } from '../../base-http.service';
|
|
3
4
|
import { CreateGuildMemberPassDto, CreateTeamMemberPassDto } from './dtos';
|
|
4
|
-
|
|
5
|
-
* Constant list of supported digital pass types.
|
|
6
|
-
*/
|
|
7
|
-
declare const supportedPassTypes: readonly ["team-member", "guild-member"];
|
|
8
|
-
/**
|
|
9
|
-
* Union type representing valid pass types.
|
|
10
|
-
*/
|
|
11
|
-
type PassType = (typeof supportedPassTypes)[number];
|
|
12
|
-
/**
|
|
13
|
-
* Maps each supported pass type to its corresponding DTO.
|
|
14
|
-
* This enables type-safe payload handling when creating passes.
|
|
15
|
-
*/
|
|
16
|
-
type PassTypeDtoMap = {
|
|
17
|
-
'team-member': CreateTeamMemberPassDto;
|
|
18
|
-
'guild-member': CreateGuildMemberPassDto;
|
|
19
|
-
};
|
|
5
|
+
import { PassType, PassTypeDtoMap } from './pass-types';
|
|
20
6
|
/**
|
|
21
7
|
* PassService
|
|
22
8
|
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* Supports both
|
|
9
|
+
* Encapsulates communication with the digital pass service.
|
|
10
|
+
* Provides unified methods for creating, retrieving, and deleting team or guild member passes.
|
|
11
|
+
* Supports both serial-number-based and type/member-based access.
|
|
26
12
|
*/
|
|
27
|
-
export declare class PassService {
|
|
28
|
-
private readonly authOptions;
|
|
29
|
-
private readonly configService;
|
|
30
|
-
private readonly logger;
|
|
31
|
-
private readonly axiosInstance;
|
|
13
|
+
export declare class PassService extends BaseHttpService {
|
|
32
14
|
/**
|
|
33
|
-
*
|
|
15
|
+
* Creates a PassService client.
|
|
34
16
|
*
|
|
35
|
-
* @param
|
|
36
|
-
* @param
|
|
17
|
+
* @param authenticationOptions Authentication options injected from the Auth module.
|
|
18
|
+
* @param configService NestJS configuration service for environment resolution.
|
|
37
19
|
*/
|
|
38
|
-
constructor(
|
|
20
|
+
constructor(authenticationOptions: AuthenticationModuleOptions, configService: ConfigService);
|
|
39
21
|
/**
|
|
40
22
|
* Fetches a digital pass by its serial number.
|
|
41
|
-
* Useful when the exact pass identifier is known.
|
|
42
23
|
*
|
|
43
24
|
* @param {string} serialNumber - Unique serial number of the pass.
|
|
44
25
|
* @returns {Promise<string>} - Returns the SAS URL of the pass.
|
|
45
26
|
*/
|
|
46
27
|
getPassBySerial(serialNumber: string): Promise<string>;
|
|
47
28
|
/**
|
|
48
|
-
* Deletes a pass
|
|
49
|
-
* Ideal for direct deletion without knowing the member details.
|
|
29
|
+
* Deletes a digital pass by its serial number.
|
|
50
30
|
*
|
|
51
|
-
* @param {string} serialNumber - Unique
|
|
31
|
+
* @param {string} serialNumber - Unique serial number of the pass.
|
|
52
32
|
*/
|
|
53
33
|
deletePassBySerial(serialNumber: string): void;
|
|
54
34
|
/**
|
|
55
35
|
* Fetches a pass based on its type and associated member ID.
|
|
56
|
-
* Abstracts the path logic for team/guild member URLs.
|
|
57
36
|
*
|
|
58
|
-
* @param {PassType} type - Type of the pass
|
|
37
|
+
* @param {PassType} type - Type of the pass.
|
|
59
38
|
* @param {string} memberId - Identifier of the associated member.
|
|
60
39
|
* @returns {Promise<string>} - Returns the SAS URL of the pass.
|
|
61
40
|
*/
|
|
62
41
|
getPassByType(type: PassType, memberId: string): Promise<string>;
|
|
63
42
|
/**
|
|
64
|
-
* Deletes a pass based on its type and member ID.
|
|
65
|
-
* Suitable when the member’s identity and role are known.
|
|
43
|
+
* Deletes a pass based on its type and associated member ID.
|
|
66
44
|
*
|
|
67
45
|
* @param {PassType} type - Type of the pass.
|
|
68
46
|
* @param {string} memberId - Identifier of the associated member.
|
|
@@ -70,7 +48,6 @@ export declare class PassService {
|
|
|
70
48
|
deletePassByType(type: PassType, memberId: string): void;
|
|
71
49
|
/**
|
|
72
50
|
* Creates a pass using its type and corresponding payload DTO.
|
|
73
|
-
* Centralizes pass creation logic with full type safety.
|
|
74
51
|
*
|
|
75
52
|
* @template Type - A specific pass type from PassType.
|
|
76
53
|
* @param {Type} type - Type of the pass to create.
|
|
@@ -119,4 +96,3 @@ export declare class PassService {
|
|
|
119
96
|
*/
|
|
120
97
|
deleteGuildMemberPass(memberId: string): void;
|
|
121
98
|
}
|
|
122
|
-
export {};
|
|
@@ -11,126 +11,110 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
11
|
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
12
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
13
|
};
|
|
14
|
-
var PassService_1;
|
|
15
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
15
|
exports.PassService = void 0;
|
|
17
16
|
const common_1 = require("@nestjs/common");
|
|
18
17
|
const config_1 = require("@nestjs/config");
|
|
19
|
-
const
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
* Constant list of supported digital pass types.
|
|
23
|
-
*/
|
|
24
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
25
|
-
const supportedPassTypes = ['team-member', 'guild-member'];
|
|
18
|
+
const authentication_1 = require("../../../authentication");
|
|
19
|
+
const base_http_service_1 = require("../../base-http.service");
|
|
20
|
+
const base_urls_1 = require("../../base-urls");
|
|
26
21
|
/**
|
|
27
22
|
* PassService
|
|
28
23
|
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
* Supports both
|
|
24
|
+
* Encapsulates communication with the digital pass service.
|
|
25
|
+
* Provides unified methods for creating, retrieving, and deleting team or guild member passes.
|
|
26
|
+
* Supports both serial-number-based and type/member-based access.
|
|
32
27
|
*/
|
|
33
|
-
let PassService =
|
|
28
|
+
let PassService = class PassService extends base_http_service_1.BaseHttpService {
|
|
34
29
|
/**
|
|
35
|
-
*
|
|
30
|
+
* Creates a PassService client.
|
|
36
31
|
*
|
|
37
|
-
* @param
|
|
38
|
-
* @param
|
|
32
|
+
* @param authenticationOptions Authentication options injected from the Auth module.
|
|
33
|
+
* @param configService NestJS configuration service for environment resolution.
|
|
39
34
|
*/
|
|
40
|
-
constructor(
|
|
41
|
-
|
|
42
|
-
this.configService = configService;
|
|
43
|
-
this.logger = new common_1.Logger(PassService_1.name);
|
|
44
|
-
const isProduction = this.configService.get('NODE_ENV') === 'production';
|
|
45
|
-
// Construct base URL conditionally based on environment.
|
|
46
|
-
const baseUrl = isProduction
|
|
47
|
-
? 'http://organisation-hub-pass-service.organisation-hub-services.svc.cluster.local:3000/internal/'
|
|
48
|
-
: 'https://services.svi-itlab.com/pass/internal/';
|
|
49
|
-
// Initialize axios instance with k8s token and appropriate URL.
|
|
50
|
-
this.axiosInstance = (0, create_internal_axios_client_function_1.createInternalAxiosClient)({
|
|
51
|
-
k8sToken: this.authOptions.k8sToken,
|
|
52
|
-
baseUrl: `${baseUrl}`,
|
|
53
|
-
});
|
|
35
|
+
constructor(authenticationOptions, configService) {
|
|
36
|
+
super('Pass', base_urls_1.BaseUrls.PassService, authenticationOptions, configService);
|
|
54
37
|
}
|
|
55
38
|
// ─────────────────────────────────────────────
|
|
56
39
|
// Serial Number-Based Operations
|
|
57
40
|
// ─────────────────────────────────────────────
|
|
58
41
|
/**
|
|
59
42
|
* Fetches a digital pass by its serial number.
|
|
60
|
-
* Useful when the exact pass identifier is known.
|
|
61
43
|
*
|
|
62
44
|
* @param {string} serialNumber - Unique serial number of the pass.
|
|
63
45
|
* @returns {Promise<string>} - Returns the SAS URL of the pass.
|
|
64
46
|
*/
|
|
65
47
|
async getPassBySerial(serialNumber) {
|
|
66
48
|
try {
|
|
67
|
-
const
|
|
49
|
+
const { data } = await this.client.get(`internal/${serialNumber}`);
|
|
68
50
|
this.logger.log(`Pass retrieved using serial: ${serialNumber}`);
|
|
69
|
-
return
|
|
51
|
+
return data;
|
|
70
52
|
}
|
|
71
53
|
catch (error) {
|
|
72
|
-
|
|
73
|
-
|
|
54
|
+
const { status, data, message } = this.parseError(error);
|
|
55
|
+
this.logger.error(`Error retrieving pass with serial ${serialNumber}: ${message}`);
|
|
56
|
+
throw new common_1.HttpException(data, status);
|
|
74
57
|
}
|
|
75
58
|
}
|
|
76
59
|
/**
|
|
77
|
-
* Deletes a pass
|
|
78
|
-
* Ideal for direct deletion without knowing the member details.
|
|
60
|
+
* Deletes a digital pass by its serial number.
|
|
79
61
|
*
|
|
80
|
-
* @param {string} serialNumber - Unique
|
|
62
|
+
* @param {string} serialNumber - Unique serial number of the pass.
|
|
81
63
|
*/
|
|
82
64
|
deletePassBySerial(serialNumber) {
|
|
83
|
-
this.
|
|
84
|
-
.delete(serialNumber)
|
|
65
|
+
this.client
|
|
66
|
+
.delete(`internal/${serialNumber}`)
|
|
85
67
|
.then(() => {
|
|
86
68
|
this.logger.log(`Pass deleted for serial: ${serialNumber}`);
|
|
87
69
|
})
|
|
88
|
-
.catch((
|
|
89
|
-
|
|
70
|
+
.catch((error) => {
|
|
71
|
+
const { message } = this.parseError(error);
|
|
72
|
+
this.logger.error(`Error deleting pass with serial ${serialNumber}: ${message}`);
|
|
90
73
|
});
|
|
91
74
|
}
|
|
92
75
|
// ─────────────────────────────────────────────
|
|
93
|
-
//
|
|
76
|
+
// Type/Member-Based Operations
|
|
94
77
|
// ─────────────────────────────────────────────
|
|
95
78
|
/**
|
|
96
79
|
* Fetches a pass based on its type and associated member ID.
|
|
97
|
-
* Abstracts the path logic for team/guild member URLs.
|
|
98
80
|
*
|
|
99
|
-
* @param {PassType} type - Type of the pass
|
|
81
|
+
* @param {PassType} type - Type of the pass.
|
|
100
82
|
* @param {string} memberId - Identifier of the associated member.
|
|
101
83
|
* @returns {Promise<string>} - Returns the SAS URL of the pass.
|
|
102
84
|
*/
|
|
103
85
|
async getPassByType(type, memberId) {
|
|
86
|
+
const endpoint = `internal/${type}/${memberId}`;
|
|
104
87
|
try {
|
|
105
|
-
const
|
|
88
|
+
const { data } = await this.client.get(endpoint);
|
|
106
89
|
this.logger.log(`Pass retrieved for ${type} member ID: ${memberId}`);
|
|
107
|
-
return
|
|
90
|
+
return data;
|
|
108
91
|
}
|
|
109
92
|
catch (error) {
|
|
110
|
-
|
|
111
|
-
|
|
93
|
+
const { status, data, message } = this.parseError(error);
|
|
94
|
+
this.logger.error(`Error retrieving ${type} pass for ${memberId}: ${message}`);
|
|
95
|
+
throw new common_1.HttpException(data, status);
|
|
112
96
|
}
|
|
113
97
|
}
|
|
114
98
|
/**
|
|
115
|
-
* Deletes a pass based on its type and member ID.
|
|
116
|
-
* Suitable when the member’s identity and role are known.
|
|
99
|
+
* Deletes a pass based on its type and associated member ID.
|
|
117
100
|
*
|
|
118
101
|
* @param {PassType} type - Type of the pass.
|
|
119
102
|
* @param {string} memberId - Identifier of the associated member.
|
|
120
103
|
*/
|
|
121
104
|
deletePassByType(type, memberId) {
|
|
122
|
-
|
|
123
|
-
|
|
105
|
+
const endpoint = `internal/${type}/${memberId}`;
|
|
106
|
+
this.client
|
|
107
|
+
.delete(endpoint)
|
|
124
108
|
.then(() => {
|
|
125
109
|
this.logger.log(`Pass deleted for ${type} member ID: ${memberId}`);
|
|
126
110
|
})
|
|
127
|
-
.catch((
|
|
128
|
-
|
|
111
|
+
.catch((error) => {
|
|
112
|
+
const { message } = this.parseError(error);
|
|
113
|
+
this.logger.error(`Error deleting ${type} pass for ${memberId}: ${message}`);
|
|
129
114
|
});
|
|
130
115
|
}
|
|
131
116
|
/**
|
|
132
117
|
* Creates a pass using its type and corresponding payload DTO.
|
|
133
|
-
* Centralizes pass creation logic with full type safety.
|
|
134
118
|
*
|
|
135
119
|
* @template Type - A specific pass type from PassType.
|
|
136
120
|
* @param {Type} type - Type of the pass to create.
|
|
@@ -139,13 +123,14 @@ let PassService = PassService_1 = class PassService {
|
|
|
139
123
|
*/
|
|
140
124
|
async createPass(type, payload) {
|
|
141
125
|
try {
|
|
142
|
-
const
|
|
126
|
+
const { data } = await this.client.post('internal/type', payload);
|
|
143
127
|
this.logger.log(`Pass successfully created for ${type}`);
|
|
144
|
-
return
|
|
128
|
+
return data;
|
|
145
129
|
}
|
|
146
130
|
catch (error) {
|
|
147
|
-
|
|
148
|
-
|
|
131
|
+
const { status, data, message } = this.parseError(error);
|
|
132
|
+
this.logger.error(`Error creating pass for ${type}: ${message}`);
|
|
133
|
+
throw new common_1.HttpException(data, status);
|
|
149
134
|
}
|
|
150
135
|
}
|
|
151
136
|
// ─────────────────────────────────────────────
|
|
@@ -208,8 +193,8 @@ let PassService = PassService_1 = class PassService {
|
|
|
208
193
|
}
|
|
209
194
|
};
|
|
210
195
|
exports.PassService = PassService;
|
|
211
|
-
exports.PassService = PassService =
|
|
196
|
+
exports.PassService = PassService = __decorate([
|
|
212
197
|
(0, common_1.Injectable)(),
|
|
213
|
-
__param(0, (0, authentication_1.
|
|
198
|
+
__param(0, (0, authentication_1.InjectAuthenticationOptions)()),
|
|
214
199
|
__metadata("design:paramtypes", [Object, config_1.ConfigService])
|
|
215
200
|
], PassService);
|