itlab-internal-services 2.15.7 → 2.16.0
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 +3 -5
- package/dist/classes/index.d.ts +1 -0
- package/dist/classes/index.js +3 -1
- package/dist/classes/report-category.class.d.ts +55 -0
- package/dist/classes/report-category.class.js +120 -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 -19
- 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 +2 -2
- package/dist/index.js +2 -2
- package/dist/likeable.interface.d.ts +1 -1
- package/dist/likeable.interface.js +2 -2
- 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 +73 -0
- package/dist/modules/authentication/guards/permissions.guard.d.ts +5 -27
- package/dist/modules/authentication/guards/permissions.guard.js +26 -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 +82 -0
- package/dist/modules/services/providers/books.service.d.ts +29 -0
- package/dist/modules/services/providers/books.service.js +53 -0
- package/dist/modules/services/providers/changelog.service.d.ts +18 -0
- package/dist/modules/services/providers/changelog.service.js +41 -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 +138 -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-types.d.ts +20 -0
- package/dist/modules/services/providers/content/content-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 +94 -0
- package/dist/modules/services/providers/content/content.service.js +214 -0
- package/dist/modules/services/providers/content/index.d.ts +1 -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 +53 -0
- package/dist/modules/services/providers/events.service.d.ts +29 -0
- package/dist/modules/services/providers/events.service.js +53 -0
- package/dist/modules/services/providers/hackschool.service.d.ts +49 -0
- package/dist/modules/services/providers/hackschool.service.js +77 -0
- package/dist/modules/services/providers/ideas.service.d.ts +18 -0
- package/dist/modules/services/providers/ideas.service.js +41 -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 +41 -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 +54 -91
- package/dist/modules/services/providers/newletter.service.d.ts +29 -0
- package/dist/modules/services/providers/newletter.service.js +53 -0
- package/dist/modules/services/providers/newsroom.service.d.ts +47 -0
- package/dist/modules/services/providers/newsroom.service.js +71 -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 +53 -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 +53 -0
- package/dist/modules/services/providers/tech-radar.service.d.ts +39 -0
- package/dist/modules/services/providers/tech-radar.service.js +65 -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/index.d.ts +1 -0
- package/dist/properties/index.js +5 -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/viewable.interface.js +1 -1
- package/package.json +2 -2
- 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/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/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
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
import { ConfigService } from '@nestjs/config';
|
|
2
|
-
import { AuthenticationModuleOptions } from '../authentication';
|
|
3
|
-
import { AuthLoginTokenMailDto, AuthPasswordResetMailDto, EventCancelMailDto, EventInviteMailDto, IdeaStatusUpdateMailDto, IdeaSubmittedMailDto, LunchRouletteCancelMailDto, LunchRouletteMatchedMailDto, LunchRouletteSubmittedMailDto, LunchRouletteUnmatchedMailDto, NewsletterIssueMailDto, NewsletterSubscribedMailDto, NewsletterUnsubscribedMailDto, NotificationMailDto } from './dtos';
|
|
4
|
-
/**
|
|
5
|
-
* Constant list of supported mail types.
|
|
6
|
-
*/
|
|
7
|
-
declare const supportedMailTypes: readonly ["auth.login-token", "auth.password-reset", "event.invite", "event.cancel", "idea.submitted", "idea.status-update", "lunch-roulette.submitted", "lunch-roulette.cancel", "lunch-roulette.matched", "lunch-roulette.unmatched", "newsletter.subscribed", "newsletter.unsubscribed", "newsletter.issue", "notification.notification"];
|
|
8
|
-
/**
|
|
9
|
-
* Union type representing valid mail kinds.
|
|
10
|
-
*/
|
|
11
|
-
type MailType = (typeof supportedMailTypes)[number];
|
|
12
|
-
/**
|
|
13
|
-
* Maps each supported mail type to its corresponding DTO.
|
|
14
|
-
* This enables type-safe payload handling when creating passes.
|
|
15
|
-
*/
|
|
16
|
-
type MailTypeDtoMap = {
|
|
17
|
-
'auth.login-token': AuthLoginTokenMailDto;
|
|
18
|
-
'auth.password-reset': AuthPasswordResetMailDto;
|
|
19
|
-
'event.invite': EventInviteMailDto;
|
|
20
|
-
'event.cancel': EventCancelMailDto;
|
|
21
|
-
'idea.submitted': IdeaSubmittedMailDto;
|
|
22
|
-
'idea.status-update': IdeaStatusUpdateMailDto;
|
|
23
|
-
'lunch-roulette.submitted': LunchRouletteSubmittedMailDto;
|
|
24
|
-
'lunch-roulette.cancel': LunchRouletteCancelMailDto;
|
|
25
|
-
'lunch-roulette.matched': LunchRouletteMatchedMailDto;
|
|
26
|
-
'lunch-roulette.unmatched': LunchRouletteUnmatchedMailDto;
|
|
27
|
-
'newsletter.subscribed': NewsletterSubscribedMailDto;
|
|
28
|
-
'newsletter.unsubscribed': NewsletterUnsubscribedMailDto;
|
|
29
|
-
'newsletter.issue': NewsletterIssueMailDto;
|
|
30
|
-
'notification.notification': NotificationMailDto;
|
|
31
|
-
};
|
|
32
|
-
/**
|
|
33
|
-
* @class MailService
|
|
34
|
-
* @description
|
|
35
|
-
* MailService provides a structured and type-safe interface for sending
|
|
36
|
-
* various types of email notifications within the platform.
|
|
37
|
-
*
|
|
38
|
-
* It integrates with the central organisation-hub-email service,
|
|
39
|
-
* automatically configuring the client based on environment (dev/prod).
|
|
40
|
-
*/
|
|
41
|
-
export declare class MailService {
|
|
42
|
-
private readonly authOptions;
|
|
43
|
-
private readonly configService;
|
|
44
|
-
private readonly logger;
|
|
45
|
-
private readonly axiosInstance;
|
|
46
|
-
/**
|
|
47
|
-
* Initializes the PassService with appropriate API client and settings.
|
|
48
|
-
*
|
|
49
|
-
* @param {AuthenticationModuleOptions} authOptions - Contains Kubernetes service account token
|
|
50
|
-
* @param {ConfigService} configService - Configuration service for environment checks
|
|
51
|
-
*/
|
|
52
|
-
constructor(authOptions: AuthenticationModuleOptions, configService: ConfigService);
|
|
53
|
-
/**
|
|
54
|
-
* Sends an email based on a provided type and payload.
|
|
55
|
-
*
|
|
56
|
-
* @template Type
|
|
57
|
-
* @param {Type} type - The type of email to send (must be a supported type).
|
|
58
|
-
* @param {MailTypeDtoMap[Type]} payload - The payload DTO matching the type.
|
|
59
|
-
*
|
|
60
|
-
* @remarks
|
|
61
|
-
* This generic method allows all email variants to be routed through
|
|
62
|
-
* one point with strong type checking for safety and consistency.
|
|
63
|
-
*/
|
|
64
|
-
send<Type extends MailType>(type: Type, payload: MailTypeDtoMap[Type]): void;
|
|
65
|
-
/**
|
|
66
|
-
* Sends an email with a one-time login token.
|
|
67
|
-
* @param {AuthLoginTokenMailDto} payload - DTO containing recipient and token.
|
|
68
|
-
*/
|
|
69
|
-
sendAuthLoginToken(payload: AuthLoginTokenMailDto): void;
|
|
70
|
-
/**
|
|
71
|
-
* Sends a password reset email with a secure link.
|
|
72
|
-
* @param {AuthPasswordResetMailDto} payload - DTO containing recipient and reset URL.
|
|
73
|
-
*/
|
|
74
|
-
sendAuthPasswordReset(payload: AuthPasswordResetMailDto): void;
|
|
75
|
-
/**
|
|
76
|
-
* Sends an event invitation email.
|
|
77
|
-
* @param {EventInviteMailDto} payload - DTO containing event details and recipient.
|
|
78
|
-
*/
|
|
79
|
-
sendEventInvite(payload: EventInviteMailDto): void;
|
|
80
|
-
/**
|
|
81
|
-
* Sends a notification about an event cancellation.
|
|
82
|
-
* @param {EventCancelMailDto} payload - DTO containing event title, time, and links.
|
|
83
|
-
*/
|
|
84
|
-
sendEventCancel(payload: EventCancelMailDto): void;
|
|
85
|
-
/**
|
|
86
|
-
* Sends a confirmation that an idea was submitted.
|
|
87
|
-
* @param {IdeaSubmittedMailDto} payload - DTO containing recipient and management URL.
|
|
88
|
-
*/
|
|
89
|
-
sendIdeaSubmitted(payload: IdeaSubmittedMailDto): void;
|
|
90
|
-
/**
|
|
91
|
-
* Sends a notification that an idea's status has changed.
|
|
92
|
-
* @param {IdeaStatusUpdateMailDto} payload - DTO containing the old and new status.
|
|
93
|
-
*/
|
|
94
|
-
sendIdeaStatusUpdate(payload: IdeaStatusUpdateMailDto): void;
|
|
95
|
-
/**
|
|
96
|
-
* Sends confirmation of lunch roulette participation.
|
|
97
|
-
* @param {LunchRouletteSubmittedMailDto} payload - DTO with recipient, location, and type.
|
|
98
|
-
*/
|
|
99
|
-
sendLunchRouletteSubmitted(payload: LunchRouletteSubmittedMailDto): void;
|
|
100
|
-
/**
|
|
101
|
-
* Sends a cancellation email for lunch roulette.
|
|
102
|
-
* @param {LunchRouletteCancelMailDto} payload - DTO containing the recipient.
|
|
103
|
-
*/
|
|
104
|
-
sendLunchRouletteCancel(payload: LunchRouletteCancelMailDto): void;
|
|
105
|
-
/**
|
|
106
|
-
* Sends a match notification to lunch roulette participants.
|
|
107
|
-
* @param {LunchRouletteMatchedMailDto} payload - DTO with recipients, message, and details URL.
|
|
108
|
-
*/
|
|
109
|
-
sendLunchRouletteMatched(payload: LunchRouletteMatchedMailDto): void;
|
|
110
|
-
/**
|
|
111
|
-
* Notifies a user that they were unmatched in lunch roulette.
|
|
112
|
-
* @param {LunchRouletteUnmatchedMailDto} payload - DTO with the unmatched recipient.
|
|
113
|
-
*/
|
|
114
|
-
sendLunchRouletteUnmatched(payload: LunchRouletteUnmatchedMailDto): void;
|
|
115
|
-
/**
|
|
116
|
-
* Sends confirmation of a newsletter subscription.
|
|
117
|
-
* @param {NewsletterSubscribedMailDto} payload - DTO with recipient information.
|
|
118
|
-
*/
|
|
119
|
-
sendNewsletterSubscribed(payload: NewsletterSubscribedMailDto): void;
|
|
120
|
-
/**
|
|
121
|
-
* Sends confirmation of newsletter unsubscription.
|
|
122
|
-
* @param {NewsletterUnsubscribedMailDto} payload - DTO with recipient information.
|
|
123
|
-
*/
|
|
124
|
-
sendNewsletterUnsubscribed(payload: NewsletterUnsubscribedMailDto): void;
|
|
125
|
-
/**
|
|
126
|
-
* Sends the latest issue of the newsletter.
|
|
127
|
-
* @param {NewsletterIssueMailDto} payload - DTO containing recipients, content, and metadata.
|
|
128
|
-
*/
|
|
129
|
-
sendNewsletterIssue(payload: NewsletterIssueMailDto): void;
|
|
130
|
-
/**
|
|
131
|
-
* Sends a general-purpose email notification.
|
|
132
|
-
* @param {NotificationMailDto} payload - DTO with recipients, title, message, and optional URL.
|
|
133
|
-
*/
|
|
134
|
-
sendNotification(payload: NotificationMailDto): void;
|
|
135
|
-
}
|
|
136
|
-
export {};
|
|
@@ -1,22 +0,0 @@
|
|
|
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
|
-
exports.NotificationService = exports.NotificationModule = void 0;
|
|
18
|
-
__exportStar(require("./dtos"), exports);
|
|
19
|
-
var notification_module_1 = require("./notification.module");
|
|
20
|
-
Object.defineProperty(exports, "NotificationModule", { enumerable: true, get: function () { return notification_module_1.NotificationModule; } });
|
|
21
|
-
var notification_service_1 = require("./notification.service");
|
|
22
|
-
Object.defineProperty(exports, "NotificationService", { enumerable: true, get: function () { return notification_service_1.NotificationService; } });
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.NOTIFICATION_MODULE_RESOURCE_TOKEN = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Token used to inject NotificationModule options into services or controllers if needed.
|
|
6
|
-
* Symbol is used to avoid accidental naming collisions across modules.
|
|
7
|
-
*/
|
|
8
|
-
exports.NOTIFICATION_MODULE_RESOURCE_TOKEN = Symbol('NOTIFICATION_MODULE_RESOURCE_TOKEN');
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { DynamicModule } from '@nestjs/common';
|
|
2
|
-
import { HubResource } from '../../hub-resource.enum';
|
|
3
|
-
/**
|
|
4
|
-
* NotificationModule
|
|
5
|
-
*
|
|
6
|
-
* Provides infrastructure to schedule and manage notifications
|
|
7
|
-
* related to a specific resource type (e.g., project, article).
|
|
8
|
-
* Delegates actual delivery and management to the internal notification service.
|
|
9
|
-
*/
|
|
10
|
-
export declare class NotificationModule {
|
|
11
|
-
/**
|
|
12
|
-
* Internal utility to generate the module configuration.
|
|
13
|
-
*
|
|
14
|
-
* @param {boolean} isGlobal - Whether the module should be globally scoped.
|
|
15
|
-
* @param {HubResource} resource - The resource associated with the module.
|
|
16
|
-
* @returns {DynamicModule} - Configured dynamic module.
|
|
17
|
-
*/
|
|
18
|
-
private static createModule;
|
|
19
|
-
/**
|
|
20
|
-
* Registers the module globally, making NotificationService accessible application-wide.
|
|
21
|
-
*
|
|
22
|
-
* @param {HubResource} resource - The resource associated with the module.
|
|
23
|
-
* @returns {DynamicModule} - Global dynamic module instance.
|
|
24
|
-
*/
|
|
25
|
-
static forRoot(resource: HubResource): DynamicModule;
|
|
26
|
-
/**
|
|
27
|
-
* Registers the module locally (non-global), restricting NotificationService
|
|
28
|
-
* to the importing module's scope.
|
|
29
|
-
*
|
|
30
|
-
* @param {HubResource} resource - The resource associated with the module.
|
|
31
|
-
* @returns {DynamicModule} - Local dynamic module instance.
|
|
32
|
-
*/
|
|
33
|
-
static register(resource: HubResource): DynamicModule;
|
|
34
|
-
}
|
|
@@ -1,63 +0,0 @@
|
|
|
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 NotificationModule_1;
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.NotificationModule = void 0;
|
|
11
|
-
const common_1 = require("@nestjs/common");
|
|
12
|
-
const notification_module_definition_1 = require("./notification.module-definition");
|
|
13
|
-
const notification_service_1 = require("./notification.service");
|
|
14
|
-
/**
|
|
15
|
-
* NotificationModule
|
|
16
|
-
*
|
|
17
|
-
* Provides infrastructure to schedule and manage notifications
|
|
18
|
-
* related to a specific resource type (e.g., project, article).
|
|
19
|
-
* Delegates actual delivery and management to the internal notification service.
|
|
20
|
-
*/
|
|
21
|
-
let NotificationModule = NotificationModule_1 = class NotificationModule {
|
|
22
|
-
/**
|
|
23
|
-
* Internal utility to generate the module configuration.
|
|
24
|
-
*
|
|
25
|
-
* @param {boolean} isGlobal - Whether the module should be globally scoped.
|
|
26
|
-
* @param {HubResource} resource - The resource associated with the module.
|
|
27
|
-
* @returns {DynamicModule} - Configured dynamic module.
|
|
28
|
-
*/
|
|
29
|
-
static createModule(isGlobal, resource) {
|
|
30
|
-
return {
|
|
31
|
-
global: isGlobal,
|
|
32
|
-
module: NotificationModule_1,
|
|
33
|
-
providers: [notification_service_1.NotificationService, { provide: notification_module_definition_1.NOTIFICATION_MODULE_RESOURCE_TOKEN, useValue: resource }],
|
|
34
|
-
exports: [notification_service_1.NotificationService],
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Registers the module globally, making NotificationService accessible application-wide.
|
|
39
|
-
*
|
|
40
|
-
* @param {HubResource} resource - The resource associated with the module.
|
|
41
|
-
* @returns {DynamicModule} - Global dynamic module instance.
|
|
42
|
-
*/
|
|
43
|
-
static forRoot(resource) {
|
|
44
|
-
return this.createModule(true, resource);
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Registers the module locally (non-global), restricting NotificationService
|
|
48
|
-
* to the importing module's scope.
|
|
49
|
-
*
|
|
50
|
-
* @param {HubResource} resource - The resource associated with the module.
|
|
51
|
-
* @returns {DynamicModule} - Local dynamic module instance.
|
|
52
|
-
*/
|
|
53
|
-
static register(resource) {
|
|
54
|
-
return this.createModule(false, resource);
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
exports.NotificationModule = NotificationModule;
|
|
58
|
-
exports.NotificationModule = NotificationModule = NotificationModule_1 = __decorate([
|
|
59
|
-
(0, common_1.Module)({
|
|
60
|
-
providers: [notification_service_1.NotificationService],
|
|
61
|
-
exports: [notification_service_1.NotificationService],
|
|
62
|
-
})
|
|
63
|
-
], NotificationModule);
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { ConfigService } from '@nestjs/config';
|
|
2
|
-
import { HubResource } from '../../hub-resource.enum';
|
|
3
|
-
import { AuthenticationModuleOptions } from '../authentication';
|
|
4
|
-
import { ScheduleNotificationDto } from './dtos';
|
|
5
|
-
/**
|
|
6
|
-
* NotificationService
|
|
7
|
-
*
|
|
8
|
-
* Provides methods to schedule and unschedule notifications for specific resources.
|
|
9
|
-
* Internally communicates with the organisation-hub notification microservice.
|
|
10
|
-
*/
|
|
11
|
-
export declare class NotificationService {
|
|
12
|
-
private readonly resource;
|
|
13
|
-
private readonly authOptions;
|
|
14
|
-
private readonly configService;
|
|
15
|
-
private logger;
|
|
16
|
-
private readonly axiosInstance;
|
|
17
|
-
/**
|
|
18
|
-
* Initializes the NotificationService with appropriate API client and settings.
|
|
19
|
-
*
|
|
20
|
-
* @param {HubResource} resource - Resource type injected via DI
|
|
21
|
-
* @param {AuthenticationModuleOptions} authOptions - Contains Kubernetes service account token
|
|
22
|
-
* @param {ConfigService} configService - Configuration service for environment checks
|
|
23
|
-
*/
|
|
24
|
-
constructor(resource: HubResource, authOptions: AuthenticationModuleOptions, configService: ConfigService);
|
|
25
|
-
/**
|
|
26
|
-
* Schedules or reschedules a notification for a given resource.
|
|
27
|
-
* If the notification already exists, it will be updated.
|
|
28
|
-
*
|
|
29
|
-
* @param {string} resourceId - Unique identifier of the resource
|
|
30
|
-
* @param {ScheduleNotificationDto} notification - Notification configuration payload
|
|
31
|
-
* @returns {void}
|
|
32
|
-
*/
|
|
33
|
-
schedule(resourceId: string, notification: ScheduleNotificationDto): void;
|
|
34
|
-
/**
|
|
35
|
-
* Unschedules a previously set notification for a given resource.
|
|
36
|
-
* This is typically called when the resource is deleted or the event is canceled.
|
|
37
|
-
*
|
|
38
|
-
* @param {string} resourceId - Identifier of the resource
|
|
39
|
-
* @returns {void}
|
|
40
|
-
*/
|
|
41
|
-
unschedule(resourceId: string): void;
|
|
42
|
-
}
|
|
@@ -1,100 +0,0 @@
|
|
|
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
|
-
const common_1 = require("@nestjs/common");
|
|
18
|
-
const config_1 = require("@nestjs/config");
|
|
19
|
-
const functions_1 = require("../../functions");
|
|
20
|
-
const hub_resource_enum_1 = require("../../hub-resource.enum");
|
|
21
|
-
const authentication_1 = require("../authentication");
|
|
22
|
-
const notification_module_definition_1 = require("./notification.module-definition");
|
|
23
|
-
/**
|
|
24
|
-
* NotificationService
|
|
25
|
-
*
|
|
26
|
-
* Provides methods to schedule and unschedule notifications for specific resources.
|
|
27
|
-
* Internally communicates with the organisation-hub notification microservice.
|
|
28
|
-
*/
|
|
29
|
-
let NotificationService = NotificationService_1 = class NotificationService {
|
|
30
|
-
/**
|
|
31
|
-
* Initializes the NotificationService with appropriate API client and settings.
|
|
32
|
-
*
|
|
33
|
-
* @param {HubResource} resource - Resource type injected via DI
|
|
34
|
-
* @param {AuthenticationModuleOptions} authOptions - Contains Kubernetes service account token
|
|
35
|
-
* @param {ConfigService} configService - Configuration service for environment checks
|
|
36
|
-
*/
|
|
37
|
-
constructor(resource, authOptions, configService) {
|
|
38
|
-
this.resource = resource;
|
|
39
|
-
this.authOptions = authOptions;
|
|
40
|
-
this.configService = configService;
|
|
41
|
-
this.logger = new common_1.Logger(NotificationService_1.name);
|
|
42
|
-
const isProduction = this.configService.get('NODE_ENV') === 'production';
|
|
43
|
-
// Construct base URL conditionally based on environment.
|
|
44
|
-
const baseUrl = isProduction
|
|
45
|
-
? 'http://organisation-hub-notifications-service.organisation-hub-services.svc.cluster.local:3000/internal/'
|
|
46
|
-
: 'https://services.svi-itlab.com/notifications/internal/';
|
|
47
|
-
// Initialize axios instance with k8s token and appropriate URL.
|
|
48
|
-
this.axiosInstance = (0, functions_1.createInternalAxiosClient)({
|
|
49
|
-
k8sToken: this.authOptions.k8sToken,
|
|
50
|
-
baseUrl: `${baseUrl}${this.resource}/`,
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
// ─────────────────────────────────────────────
|
|
54
|
-
// Notification Scheduling
|
|
55
|
-
// ─────────────────────────────────────────────
|
|
56
|
-
/**
|
|
57
|
-
* Schedules or reschedules a notification for a given resource.
|
|
58
|
-
* If the notification already exists, it will be updated.
|
|
59
|
-
*
|
|
60
|
-
* @param {string} resourceId - Unique identifier of the resource
|
|
61
|
-
* @param {ScheduleNotificationDto} notification - Notification configuration payload
|
|
62
|
-
* @returns {void}
|
|
63
|
-
*/
|
|
64
|
-
schedule(resourceId, notification) {
|
|
65
|
-
this.logger.log(`Scheduling notification for ${this.resource} (${resourceId})`);
|
|
66
|
-
this.axiosInstance
|
|
67
|
-
.post(`${resourceId}`, notification)
|
|
68
|
-
.then(() => {
|
|
69
|
-
this.logger.log(`Successfully scheduled ${this.resource} (${resourceId})`);
|
|
70
|
-
})
|
|
71
|
-
.catch(({ response }) => {
|
|
72
|
-
this.logger.error(`Failed to schedule ${this.resource} (${resourceId}): ${JSON.stringify(response === null || response === void 0 ? void 0 : response.data)}`);
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Unschedules a previously set notification for a given resource.
|
|
77
|
-
* This is typically called when the resource is deleted or the event is canceled.
|
|
78
|
-
*
|
|
79
|
-
* @param {string} resourceId - Identifier of the resource
|
|
80
|
-
* @returns {void}
|
|
81
|
-
*/
|
|
82
|
-
unschedule(resourceId) {
|
|
83
|
-
this.logger.log(`Unscheduling notification for ${this.resource} (${resourceId})`);
|
|
84
|
-
this.axiosInstance
|
|
85
|
-
.delete(`${resourceId}`)
|
|
86
|
-
.then(() => {
|
|
87
|
-
this.logger.log(`Successfully unscheduled ${this.resource} (${resourceId})`);
|
|
88
|
-
})
|
|
89
|
-
.catch(({ response }) => {
|
|
90
|
-
this.logger.error(`Failed to unschedule ${this.resource} (${resourceId}): ${JSON.stringify(response === null || response === void 0 ? void 0 : response.data)}`);
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
|
-
};
|
|
94
|
-
exports.NotificationService = NotificationService;
|
|
95
|
-
exports.NotificationService = NotificationService = NotificationService_1 = __decorate([
|
|
96
|
-
(0, common_1.Injectable)(),
|
|
97
|
-
__param(0, (0, common_1.Inject)(notification_module_definition_1.NOTIFICATION_MODULE_RESOURCE_TOKEN)),
|
|
98
|
-
__param(1, (0, authentication_1.InjectAuthOptions)()),
|
|
99
|
-
__metadata("design:paramtypes", [String, Object, config_1.ConfigService])
|
|
100
|
-
], NotificationService);
|
|
@@ -1,22 +0,0 @@
|
|
|
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
|
-
exports.PassService = exports.PassModule = void 0;
|
|
18
|
-
__exportStar(require("./dtos"), exports);
|
|
19
|
-
var pass_module_1 = require("./pass.module");
|
|
20
|
-
Object.defineProperty(exports, "PassModule", { enumerable: true, get: function () { return pass_module_1.PassModule; } });
|
|
21
|
-
var pass_service_1 = require("./pass.service");
|
|
22
|
-
Object.defineProperty(exports, "PassService", { enumerable: true, get: function () { return pass_service_1.PassService; } });
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { DynamicModule } from '@nestjs/common';
|
|
2
|
-
/**
|
|
3
|
-
* PassModule
|
|
4
|
-
*
|
|
5
|
-
* Central module for managing digital passes. Provides services for creating,
|
|
6
|
-
* deleting, and securely accessing pass files.
|
|
7
|
-
*
|
|
8
|
-
* - Use `PassModule.forRoot()` to make the module globally available across the application.
|
|
9
|
-
* - Use `PassModule.register()` for feature-scoped usage in specific modules.
|
|
10
|
-
*/
|
|
11
|
-
export declare class PassModule {
|
|
12
|
-
/**
|
|
13
|
-
* Internal utility to generate the module configuration.
|
|
14
|
-
*
|
|
15
|
-
* @param {boolean} isGlobal - Whether the module should be globally scoped.
|
|
16
|
-
* @returns {DynamicModule} - Configured dynamic module.
|
|
17
|
-
*/
|
|
18
|
-
private static createModule;
|
|
19
|
-
/**
|
|
20
|
-
* Registers the module globally, making PassService accessible application-wide.
|
|
21
|
-
*
|
|
22
|
-
* @returns {DynamicModule} - Global dynamic module instance.
|
|
23
|
-
*/
|
|
24
|
-
static forRoot(): DynamicModule;
|
|
25
|
-
/**
|
|
26
|
-
* Registers the module locally (non-global), restricting PassService
|
|
27
|
-
* to the importing module's scope.
|
|
28
|
-
*
|
|
29
|
-
* @returns {DynamicModule} - Local dynamic module instance.
|
|
30
|
-
*/
|
|
31
|
-
static register(): DynamicModule;
|
|
32
|
-
}
|
|
@@ -1,61 +0,0 @@
|
|
|
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 PassModule_1;
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.PassModule = void 0;
|
|
11
|
-
const common_1 = require("@nestjs/common");
|
|
12
|
-
const pass_service_1 = require("./pass.service");
|
|
13
|
-
/**
|
|
14
|
-
* PassModule
|
|
15
|
-
*
|
|
16
|
-
* Central module for managing digital passes. Provides services for creating,
|
|
17
|
-
* deleting, and securely accessing pass files.
|
|
18
|
-
*
|
|
19
|
-
* - Use `PassModule.forRoot()` to make the module globally available across the application.
|
|
20
|
-
* - Use `PassModule.register()` for feature-scoped usage in specific modules.
|
|
21
|
-
*/
|
|
22
|
-
let PassModule = PassModule_1 = class PassModule {
|
|
23
|
-
/**
|
|
24
|
-
* Internal utility to generate the module configuration.
|
|
25
|
-
*
|
|
26
|
-
* @param {boolean} isGlobal - Whether the module should be globally scoped.
|
|
27
|
-
* @returns {DynamicModule} - Configured dynamic module.
|
|
28
|
-
*/
|
|
29
|
-
static createModule(isGlobal) {
|
|
30
|
-
return {
|
|
31
|
-
global: isGlobal,
|
|
32
|
-
module: PassModule_1,
|
|
33
|
-
providers: [pass_service_1.PassService],
|
|
34
|
-
exports: [pass_service_1.PassService],
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Registers the module globally, making PassService accessible application-wide.
|
|
39
|
-
*
|
|
40
|
-
* @returns {DynamicModule} - Global dynamic module instance.
|
|
41
|
-
*/
|
|
42
|
-
static forRoot() {
|
|
43
|
-
return this.createModule(true);
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Registers the module locally (non-global), restricting PassService
|
|
47
|
-
* to the importing module's scope.
|
|
48
|
-
*
|
|
49
|
-
* @returns {DynamicModule} - Local dynamic module instance.
|
|
50
|
-
*/
|
|
51
|
-
static register() {
|
|
52
|
-
return this.createModule(false);
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
exports.PassModule = PassModule;
|
|
56
|
-
exports.PassModule = PassModule = PassModule_1 = __decorate([
|
|
57
|
-
(0, common_1.Module)({
|
|
58
|
-
providers: [pass_service_1.PassService],
|
|
59
|
-
exports: [pass_service_1.PassService],
|
|
60
|
-
})
|
|
61
|
-
], PassModule);
|
|
@@ -1,23 +0,0 @@
|
|
|
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
|
-
exports.SearchService = exports.SearchModule = void 0;
|
|
18
|
-
__exportStar(require("./dtos"), exports);
|
|
19
|
-
__exportStar(require("./models"), exports);
|
|
20
|
-
var search_module_1 = require("./search.module");
|
|
21
|
-
Object.defineProperty(exports, "SearchModule", { enumerable: true, get: function () { return search_module_1.SearchModule; } });
|
|
22
|
-
var search_service_1 = require("./search.service");
|
|
23
|
-
Object.defineProperty(exports, "SearchService", { enumerable: true, get: function () { return search_service_1.SearchService; } });
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './search-document.model';
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SEARCH_MODULE_RESOURCE_TOKEN = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Token used to inject SearchModule options into services or controllers if needed.
|
|
6
|
-
* Symbol is used to avoid accidental naming collisions across modules.
|
|
7
|
-
*/
|
|
8
|
-
exports.SEARCH_MODULE_RESOURCE_TOKEN = Symbol('SEARCH_MODULE_RESOURCE_TOKEN');
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { DynamicModule } from '@nestjs/common';
|
|
2
|
-
import { HubResource } from '../../hub-resource.enum';
|
|
3
|
-
/**
|
|
4
|
-
* SearchModule
|
|
5
|
-
*
|
|
6
|
-
* Provides search functionality through indexing, deletion, and similarity search.
|
|
7
|
-
* Connects to an external Meilisearch-based service.
|
|
8
|
-
*/
|
|
9
|
-
export declare class SearchModule {
|
|
10
|
-
/**
|
|
11
|
-
* Internal utility to generate the module configuration.
|
|
12
|
-
*
|
|
13
|
-
* @param {boolean} isGlobal - Whether the module should be globally scoped.
|
|
14
|
-
* @param {HubResource} resource - The resource associated with the module.
|
|
15
|
-
* @returns {DynamicModule} - Configured dynamic module.
|
|
16
|
-
*/
|
|
17
|
-
private static createModule;
|
|
18
|
-
/**
|
|
19
|
-
* Registers the module globally, making SearchService accessible application-wide.
|
|
20
|
-
*
|
|
21
|
-
* @param {HubResource} resource - The resource associated with the module.
|
|
22
|
-
* @returns {DynamicModule} - Global dynamic module instance.
|
|
23
|
-
*/
|
|
24
|
-
static forRoot(resource: HubResource): DynamicModule;
|
|
25
|
-
/**
|
|
26
|
-
* Registers the module locally (non-global), restricting SearchService
|
|
27
|
-
* to the importing module's scope.
|
|
28
|
-
*
|
|
29
|
-
* @param {HubResource} resource - The resource associated with the module.
|
|
30
|
-
* @returns {DynamicModule} - Local dynamic module instance.
|
|
31
|
-
*/
|
|
32
|
-
static register(resource: HubResource): DynamicModule;
|
|
33
|
-
}
|