itlab-internal-services 2.15.6 → 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
|
@@ -0,0 +1,82 @@
|
|
|
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.AccountsService = void 0;
|
|
16
|
+
const config_1 = require("@nestjs/config");
|
|
17
|
+
const authentication_1 = require("../../authentication");
|
|
18
|
+
const base_http_service_1 = require("../base-http.service");
|
|
19
|
+
const base_urls_1 = require("../base-urls");
|
|
20
|
+
/**
|
|
21
|
+
* AccountsService
|
|
22
|
+
*
|
|
23
|
+
* Service client for interacting with the Accounts domain.
|
|
24
|
+
* Inherits logging, authentication, and environment-sensitive URL resolution from `BaseHttpService`.
|
|
25
|
+
*/
|
|
26
|
+
let AccountsService = class AccountsService extends base_http_service_1.BaseHttpService {
|
|
27
|
+
/**
|
|
28
|
+
* Constructs a Accounts service client.
|
|
29
|
+
*
|
|
30
|
+
* @param {AuthenticationModuleOptions} authenticationOptions - Authentication options (provided by DI).
|
|
31
|
+
* @param {ConfigService} configService - Global NestJS config service for environment detection.
|
|
32
|
+
*/
|
|
33
|
+
constructor(authenticationOptions, configService) {
|
|
34
|
+
super('Accounts', base_urls_1.BaseUrls.AccountsService, authenticationOptions, configService);
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Retrieves a single account entry by its MongoDB identifier.
|
|
38
|
+
*
|
|
39
|
+
* If the downstream call fails or the resource does not exist, the method
|
|
40
|
+
* will log the failure and return `undefined`.
|
|
41
|
+
*
|
|
42
|
+
* @param {string} accountId - Unique MongoDB identifier of the account item.
|
|
43
|
+
* @returns {Promise<Account | undefined>} Resolves to the account object if found, otherwise `undefined`.
|
|
44
|
+
*/
|
|
45
|
+
async getAccount(accountId) {
|
|
46
|
+
return this.fetchResource(`internal/account/${accountId}`);
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Retrieves a collection of account entries by their MongoDB identifiers.
|
|
50
|
+
*
|
|
51
|
+
* If the downstream call fails, an empty array is returned.
|
|
52
|
+
*
|
|
53
|
+
* @param {string[]} accountIds - Array of MongoDB identifiers for the account items.
|
|
54
|
+
* @returns {Promise<Account[]>} Resolves to an array of account objects (empty if none found).
|
|
55
|
+
*/
|
|
56
|
+
async getAccountCollection(accountIds) {
|
|
57
|
+
return this.fetchResourceCollection(`internal/accounts`, { params: { ids: accountIds } });
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Retrieves a single user entry derived from an account.
|
|
61
|
+
*
|
|
62
|
+
* @param {string} userId - Unique identifier of the user (mapped from account ID).
|
|
63
|
+
* @returns {Promise<User | undefined>} Resolves to the user object if found, otherwise `undefined`.
|
|
64
|
+
*/
|
|
65
|
+
async getUser(userId) {
|
|
66
|
+
return this.fetchResource(`internal/user/${userId}`);
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Retrieves multiple users in a single request.
|
|
70
|
+
*
|
|
71
|
+
* @param {string[]} userIds - Array of user identifiers (mapped from account IDs).
|
|
72
|
+
* @returns {Promise<User[]>} Resolves to a list of users (empty array if none found).
|
|
73
|
+
*/
|
|
74
|
+
async getUserCollection(userIds) {
|
|
75
|
+
return this.fetchResourceCollection(`internal/users`, { params: { ids: userIds } });
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
exports.AccountsService = AccountsService;
|
|
79
|
+
exports.AccountsService = AccountsService = __decorate([
|
|
80
|
+
__param(0, (0, authentication_1.InjectAuthenticationOptions)()),
|
|
81
|
+
__metadata("design:paramtypes", [Object, config_1.ConfigService])
|
|
82
|
+
], AccountsService);
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ConfigService } from '@nestjs/config';
|
|
2
|
+
import { LabBook } from 'itlab-functions';
|
|
3
|
+
import { AuthenticationModuleOptions } from '../../authentication';
|
|
4
|
+
import { BaseHttpService } from '../base-http.service';
|
|
5
|
+
/**
|
|
6
|
+
* BooksService
|
|
7
|
+
*
|
|
8
|
+
* Service client for interacting with the Books domain.
|
|
9
|
+
* Inherits logging, authentication, and environment-sensitive URL resolution from `BaseHttpService`.
|
|
10
|
+
*/
|
|
11
|
+
export declare class BooksService extends BaseHttpService {
|
|
12
|
+
/**
|
|
13
|
+
* Constructs a Books service client.
|
|
14
|
+
*
|
|
15
|
+
* @param {AuthenticationModuleOptions} authenticationOptions - Authentication options (provided by DI).
|
|
16
|
+
* @param {ConfigService} configService - Global NestJS config service for environment detection.
|
|
17
|
+
*/
|
|
18
|
+
constructor(authenticationOptions: AuthenticationModuleOptions, configService: ConfigService);
|
|
19
|
+
/**
|
|
20
|
+
* Retrieves a single book entry by its MongoDB identifier.
|
|
21
|
+
*
|
|
22
|
+
* If the downstream call fails or the resource does not exist, the method
|
|
23
|
+
* will log the failure and return `undefined`.
|
|
24
|
+
*
|
|
25
|
+
* @param {string} bookId - Unique MongoDB identifier of the book item.
|
|
26
|
+
* @returns {Promise<LabBook | undefined>} Resolves to the book object if found, otherwise `undefined`.
|
|
27
|
+
*/
|
|
28
|
+
fetchBookById(bookId?: string): Promise<LabBook>;
|
|
29
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
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.BooksService = void 0;
|
|
16
|
+
const config_1 = require("@nestjs/config");
|
|
17
|
+
const authentication_1 = require("../../authentication");
|
|
18
|
+
const base_http_service_1 = require("../base-http.service");
|
|
19
|
+
const base_urls_1 = require("../base-urls");
|
|
20
|
+
/**
|
|
21
|
+
* BooksService
|
|
22
|
+
*
|
|
23
|
+
* Service client for interacting with the Books domain.
|
|
24
|
+
* Inherits logging, authentication, and environment-sensitive URL resolution from `BaseHttpService`.
|
|
25
|
+
*/
|
|
26
|
+
let BooksService = class BooksService extends base_http_service_1.BaseHttpService {
|
|
27
|
+
/**
|
|
28
|
+
* Constructs a Books service client.
|
|
29
|
+
*
|
|
30
|
+
* @param {AuthenticationModuleOptions} authenticationOptions - Authentication options (provided by DI).
|
|
31
|
+
* @param {ConfigService} configService - Global NestJS config service for environment detection.
|
|
32
|
+
*/
|
|
33
|
+
constructor(authenticationOptions, configService) {
|
|
34
|
+
super('Books', base_urls_1.BaseUrls.BooksService, authenticationOptions, configService);
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Retrieves a single book entry by its MongoDB identifier.
|
|
38
|
+
*
|
|
39
|
+
* If the downstream call fails or the resource does not exist, the method
|
|
40
|
+
* will log the failure and return `undefined`.
|
|
41
|
+
*
|
|
42
|
+
* @param {string} bookId - Unique MongoDB identifier of the book item.
|
|
43
|
+
* @returns {Promise<LabBook | undefined>} Resolves to the book object if found, otherwise `undefined`.
|
|
44
|
+
*/
|
|
45
|
+
async fetchBookById(bookId) {
|
|
46
|
+
return this.fetchResource(`internal/book/${bookId}`);
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
exports.BooksService = BooksService;
|
|
50
|
+
exports.BooksService = BooksService = __decorate([
|
|
51
|
+
__param(0, (0, authentication_1.InjectAuthenticationOptions)()),
|
|
52
|
+
__metadata("design:paramtypes", [Object, config_1.ConfigService])
|
|
53
|
+
], BooksService);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ConfigService } from '@nestjs/config';
|
|
2
|
+
import { AuthenticationModuleOptions } from '../../authentication';
|
|
3
|
+
import { BaseHttpService } from '../base-http.service';
|
|
4
|
+
/**
|
|
5
|
+
* ChangelogService
|
|
6
|
+
*
|
|
7
|
+
* Service client for interacting with the Changelog domain.
|
|
8
|
+
* Inherits logging, authentication, and environment-sensitive URL resolution from `BaseHttpService`.
|
|
9
|
+
*/
|
|
10
|
+
export declare class ChangelogService extends BaseHttpService {
|
|
11
|
+
/**
|
|
12
|
+
* Constructs a Changelog service client.
|
|
13
|
+
*
|
|
14
|
+
* @param {AuthenticationModuleOptions} authenticationOptions - Authentication options (provided by DI).
|
|
15
|
+
* @param {ConfigService} configService - Global NestJS config service for environment detection.
|
|
16
|
+
*/
|
|
17
|
+
constructor(authenticationOptions: AuthenticationModuleOptions, configService: ConfigService);
|
|
18
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
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.ChangelogService = void 0;
|
|
16
|
+
const config_1 = require("@nestjs/config");
|
|
17
|
+
const authentication_1 = require("../../authentication");
|
|
18
|
+
const base_http_service_1 = require("../base-http.service");
|
|
19
|
+
const base_urls_1 = require("../base-urls");
|
|
20
|
+
/**
|
|
21
|
+
* ChangelogService
|
|
22
|
+
*
|
|
23
|
+
* Service client for interacting with the Changelog domain.
|
|
24
|
+
* Inherits logging, authentication, and environment-sensitive URL resolution from `BaseHttpService`.
|
|
25
|
+
*/
|
|
26
|
+
let ChangelogService = class ChangelogService extends base_http_service_1.BaseHttpService {
|
|
27
|
+
/**
|
|
28
|
+
* Constructs a Changelog service client.
|
|
29
|
+
*
|
|
30
|
+
* @param {AuthenticationModuleOptions} authenticationOptions - Authentication options (provided by DI).
|
|
31
|
+
* @param {ConfigService} configService - Global NestJS config service for environment detection.
|
|
32
|
+
*/
|
|
33
|
+
constructor(authenticationOptions, configService) {
|
|
34
|
+
super('Changelog', base_urls_1.BaseUrls.ChangelogService, authenticationOptions, configService);
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
exports.ChangelogService = ChangelogService;
|
|
38
|
+
exports.ChangelogService = ChangelogService = __decorate([
|
|
39
|
+
__param(0, (0, authentication_1.InjectAuthenticationOptions)()),
|
|
40
|
+
__metadata("design:paramtypes", [Object, config_1.ConfigService])
|
|
41
|
+
], ChangelogService);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const FEATURE_COMMENTS_SERVICE_TOKEN: unique symbol;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { DynamicModule } from '@nestjs/common';
|
|
2
|
+
import { ConfigService } from '@nestjs/config';
|
|
3
|
+
import { LabCommentPopulated } from 'itlab-functions';
|
|
4
|
+
import { HubResource } from '../../../../hub-resource.enum';
|
|
5
|
+
import { AuthenticationModuleOptions } from '../../../authentication';
|
|
6
|
+
import { CacheService } from '../../../cache';
|
|
7
|
+
import { BaseHttpService } from '../../base-http.service';
|
|
8
|
+
import { ServicesModuleOptions } from '../../services-module-options.interface';
|
|
9
|
+
/**
|
|
10
|
+
* Parameter decorator to inject the feature-specific CommentsService.
|
|
11
|
+
*/
|
|
12
|
+
export declare function InjectFeatureCommentService(): ParameterDecorator;
|
|
13
|
+
/**
|
|
14
|
+
* CommentsService
|
|
15
|
+
*
|
|
16
|
+
* Handles all HTTP interactions with the Comments domain.
|
|
17
|
+
* Inherits authentication, logging, and environment-aware behaviors from BaseHttpService.
|
|
18
|
+
*/
|
|
19
|
+
export declare class CommentsService extends BaseHttpService {
|
|
20
|
+
readonly options: ServicesModuleOptions;
|
|
21
|
+
private readonly cacheService?;
|
|
22
|
+
/**
|
|
23
|
+
* Creates a CommentsService client for a specific resource.
|
|
24
|
+
*
|
|
25
|
+
* @param authenticationOptions Authentication options injected from the Auth module.
|
|
26
|
+
* @param options Options specifying the resource type this service operates on.
|
|
27
|
+
* @param configService NestJS configuration service for environment variables and URLs.
|
|
28
|
+
* @param cacheService Optional caching service for retrieving content efficiently.
|
|
29
|
+
*/
|
|
30
|
+
constructor(authenticationOptions: AuthenticationModuleOptions, options: ServicesModuleOptions, configService: ConfigService, cacheService?: CacheService);
|
|
31
|
+
/**
|
|
32
|
+
* Factory method to create a dynamic module for a specific Hub resource.
|
|
33
|
+
*
|
|
34
|
+
* @param resource The HubResource type this module will provide comments services for.
|
|
35
|
+
* @returns A DynamicModule with a provider for the specified CommentsService instance.
|
|
36
|
+
*/
|
|
37
|
+
static forResource(resource: HubResource): DynamicModule;
|
|
38
|
+
/**
|
|
39
|
+
* Deletes all comments for a given resource.
|
|
40
|
+
* Logs success or failure. Does not throw to avoid disrupting cleanup flows.
|
|
41
|
+
*
|
|
42
|
+
* @param resourceId Unique identifier of the resource whose comments will be deleted.
|
|
43
|
+
*/
|
|
44
|
+
deleteComments(resourceId: string): void;
|
|
45
|
+
/**
|
|
46
|
+
* Retrieves comments from the backend.
|
|
47
|
+
* Provides default values if comments retrieval fails.
|
|
48
|
+
*
|
|
49
|
+
* @param resourceId Unique identifier of the resource.
|
|
50
|
+
* @returns Retrieved comments.
|
|
51
|
+
*/
|
|
52
|
+
getPopulatedComments(resourceId: string): Promise<LabCommentPopulated[]>;
|
|
53
|
+
/**
|
|
54
|
+
* Retrieves comments from the cache if available; otherwise fetches from the backend.
|
|
55
|
+
*
|
|
56
|
+
* @param resourceId Unique identifier of the resource.
|
|
57
|
+
* @returns Cached or freshly retrieved comments.
|
|
58
|
+
*/
|
|
59
|
+
getCachedPopulatedComments(resourceId: string): Promise<LabCommentPopulated[]>;
|
|
60
|
+
}
|
|
@@ -0,0 +1,138 @@
|
|
|
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 CommentsService_1;
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.CommentsService = void 0;
|
|
17
|
+
exports.InjectFeatureCommentService = InjectFeatureCommentService;
|
|
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 cache_1 = require("../../../cache");
|
|
23
|
+
const base_http_service_1 = require("../../base-http.service");
|
|
24
|
+
const base_urls_1 = require("../../base-urls");
|
|
25
|
+
const services_options_parameter_1 = require("../../services-options.parameter");
|
|
26
|
+
const comments_service_definition_1 = require("./comments.service-definition");
|
|
27
|
+
/**
|
|
28
|
+
* Parameter decorator to inject the feature-specific CommentsService.
|
|
29
|
+
*/
|
|
30
|
+
function InjectFeatureCommentService() {
|
|
31
|
+
return (0, common_1.Inject)(comments_service_definition_1.FEATURE_COMMENTS_SERVICE_TOKEN);
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* CommentsService
|
|
35
|
+
*
|
|
36
|
+
* Handles all HTTP interactions with the Comments domain.
|
|
37
|
+
* Inherits authentication, logging, and environment-aware behaviors from BaseHttpService.
|
|
38
|
+
*/
|
|
39
|
+
let CommentsService = CommentsService_1 = class CommentsService extends base_http_service_1.BaseHttpService {
|
|
40
|
+
/**
|
|
41
|
+
* Creates a CommentsService client for a specific resource.
|
|
42
|
+
*
|
|
43
|
+
* @param authenticationOptions Authentication options injected from the Auth module.
|
|
44
|
+
* @param options Options specifying the resource type this service operates on.
|
|
45
|
+
* @param configService NestJS configuration service for environment variables and URLs.
|
|
46
|
+
* @param cacheService Optional caching service for retrieving content efficiently.
|
|
47
|
+
*/
|
|
48
|
+
constructor(authenticationOptions, options, configService, cacheService) {
|
|
49
|
+
super('Comments', base_urls_1.BaseUrls.CommentsService, authenticationOptions, configService);
|
|
50
|
+
this.options = options;
|
|
51
|
+
this.cacheService = cacheService;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Factory method to create a dynamic module for a specific Hub resource.
|
|
55
|
+
*
|
|
56
|
+
* @param resource The HubResource type this module will provide comments services for.
|
|
57
|
+
* @returns A DynamicModule with a provider for the specified CommentsService instance.
|
|
58
|
+
*/
|
|
59
|
+
static forResource(resource) {
|
|
60
|
+
let CommentsModule = class CommentsModule {
|
|
61
|
+
};
|
|
62
|
+
CommentsModule = __decorate([
|
|
63
|
+
(0, common_1.Module)({})
|
|
64
|
+
], CommentsModule);
|
|
65
|
+
return {
|
|
66
|
+
module: CommentsModule,
|
|
67
|
+
exports: [comments_service_definition_1.FEATURE_COMMENTS_SERVICE_TOKEN],
|
|
68
|
+
providers: [
|
|
69
|
+
{
|
|
70
|
+
provide: comments_service_definition_1.FEATURE_COMMENTS_SERVICE_TOKEN,
|
|
71
|
+
inject: [authentication_module_definition_1.AUTHENTICATION_MODULE_OPTIONS_TOKEN, config_1.ConfigService],
|
|
72
|
+
useFactory: (authenticationOptions, configService) => {
|
|
73
|
+
return new CommentsService_1(authenticationOptions, { resource }, configService);
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
],
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Deletes all comments for a given resource.
|
|
81
|
+
* Logs success or failure. Does not throw to avoid disrupting cleanup flows.
|
|
82
|
+
*
|
|
83
|
+
* @param resourceId Unique identifier of the resource whose comments will be deleted.
|
|
84
|
+
*/
|
|
85
|
+
deleteComments(resourceId) {
|
|
86
|
+
if (!this.options.resource) {
|
|
87
|
+
this.logger.error('Cannot delete comments: Resource type not provided.');
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
const endpoint = `internal/${this.options.resource}/${resourceId}`;
|
|
91
|
+
this.logger.log(`Deleting all comments for ${this.options.resource} ${resourceId}...`);
|
|
92
|
+
this.client
|
|
93
|
+
.delete(endpoint)
|
|
94
|
+
.then(() => {
|
|
95
|
+
this.logger.log(`All comments for ${this.options.resource} ${resourceId} deleted successfully.`);
|
|
96
|
+
})
|
|
97
|
+
.catch((error) => {
|
|
98
|
+
const { message } = this.parseError(error);
|
|
99
|
+
this.logger.error(`Failed to delete comments for ${this.options.resource} ${resourceId}: ${message}`);
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Retrieves comments from the backend.
|
|
104
|
+
* Provides default values if comments retrieval fails.
|
|
105
|
+
*
|
|
106
|
+
* @param resourceId Unique identifier of the resource.
|
|
107
|
+
* @returns Retrieved comments.
|
|
108
|
+
*/
|
|
109
|
+
async getPopulatedComments(resourceId) {
|
|
110
|
+
if (!this.options.resource) {
|
|
111
|
+
this.logger.error('Cannot fetch comments: Resource type not provided.');
|
|
112
|
+
return [];
|
|
113
|
+
}
|
|
114
|
+
return this.fetchResourceCollection(`internal/${this.options.resource}/${resourceId}/populated`);
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Retrieves comments from the cache if available; otherwise fetches from the backend.
|
|
118
|
+
*
|
|
119
|
+
* @param resourceId Unique identifier of the resource.
|
|
120
|
+
* @returns Cached or freshly retrieved comments.
|
|
121
|
+
*/
|
|
122
|
+
async getCachedPopulatedComments(resourceId) {
|
|
123
|
+
const fetchPopulatedComments = () => this.getPopulatedComments(resourceId);
|
|
124
|
+
if (this.cacheService) {
|
|
125
|
+
const cacheKey = `${this.options.resource}.${resourceId}.populatedComments`;
|
|
126
|
+
return this.cacheService.fetchOrStore(cacheKey, fetchPopulatedComments, 30000);
|
|
127
|
+
}
|
|
128
|
+
return fetchPopulatedComments();
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
exports.CommentsService = CommentsService;
|
|
132
|
+
exports.CommentsService = CommentsService = CommentsService_1 = __decorate([
|
|
133
|
+
__param(0, (0, authentication_1.InjectAuthenticationOptions)()),
|
|
134
|
+
__param(1, (0, services_options_parameter_1.InjectServicesOptions)()),
|
|
135
|
+
__param(3, (0, common_1.Optional)()),
|
|
136
|
+
__metadata("design:paramtypes", [Object, Object, config_1.ConfigService,
|
|
137
|
+
cache_1.CacheService])
|
|
138
|
+
], CommentsService);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './comments.service';
|
|
@@ -14,4 +14,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./
|
|
17
|
+
__exportStar(require("./comments.service"), exports);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { LabContent, LabContentPopulated } from 'itlab-functions';
|
|
2
|
+
/**
|
|
3
|
+
* Constant list of supported digital pass types.
|
|
4
|
+
*/
|
|
5
|
+
declare const supportedContentTypes: readonly ["json", "text", "html", "populated"];
|
|
6
|
+
/**
|
|
7
|
+
* Union type representing valid pass types.
|
|
8
|
+
*/
|
|
9
|
+
export type ContentType = (typeof supportedContentTypes)[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 ContentTypeReturnTypeMap = {
|
|
15
|
+
json: LabContent;
|
|
16
|
+
text: string;
|
|
17
|
+
html: LabContent;
|
|
18
|
+
populated: LabContentPopulated;
|
|
19
|
+
};
|
|
20
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const FEATURE_CONTENT_SERVICE_TOKEN: unique symbol;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { DynamicModule } from '@nestjs/common';
|
|
2
|
+
import { ConfigService } from '@nestjs/config';
|
|
3
|
+
import { LabContent } from 'itlab-functions';
|
|
4
|
+
import { HubResource } from '../../../../hub-resource.enum';
|
|
5
|
+
import { AuthenticationModuleOptions } from '../../../authentication';
|
|
6
|
+
import { CacheService } from '../../../cache';
|
|
7
|
+
import { BaseHttpService } from '../../base-http.service';
|
|
8
|
+
import { ServicesModuleOptions } from '../../services-module-options.interface';
|
|
9
|
+
import { ContentType, ContentTypeReturnTypeMap } from './content-types';
|
|
10
|
+
/**
|
|
11
|
+
* Parameter decorator to inject the feature-specific ContentService.
|
|
12
|
+
*/
|
|
13
|
+
export declare function InjectFeatureContentService(): ParameterDecorator;
|
|
14
|
+
/**
|
|
15
|
+
* Service responsible for all operations with the Organisation Hub Content Service.
|
|
16
|
+
*
|
|
17
|
+
* This includes:
|
|
18
|
+
* - Validating content structure before submission.
|
|
19
|
+
* - Submitting content to the backend.
|
|
20
|
+
* - Removing content from the backend.
|
|
21
|
+
* - Retrieving content in multiple formats.
|
|
22
|
+
*
|
|
23
|
+
* Optionally supports caching via `CacheService` for read operations.
|
|
24
|
+
*/
|
|
25
|
+
export declare class ContentService extends BaseHttpService {
|
|
26
|
+
readonly options: ServicesModuleOptions;
|
|
27
|
+
private readonly cacheService?;
|
|
28
|
+
/**
|
|
29
|
+
* Creates a ContentService client for a specific resource.
|
|
30
|
+
*
|
|
31
|
+
* @param authenticationOptions Authentication options injected from the Auth module.
|
|
32
|
+
* @param options Options specifying the resource type this service operates on.
|
|
33
|
+
* @param configService NestJS configuration service for environment variables and URLs.
|
|
34
|
+
* @param cacheService Optional caching service for retrieving content efficiently.
|
|
35
|
+
*/
|
|
36
|
+
constructor(authenticationOptions: AuthenticationModuleOptions, options: ServicesModuleOptions, configService: ConfigService, cacheService?: CacheService);
|
|
37
|
+
/**
|
|
38
|
+
* Factory method to create a dynamic module for a specific Hub resource.
|
|
39
|
+
*
|
|
40
|
+
* @param resource The HubResource type this module will provide content services for.
|
|
41
|
+
* @returns A DynamicModule with a provider for the specified ContentService instance.
|
|
42
|
+
*/
|
|
43
|
+
static forResource(resource: HubResource): DynamicModule;
|
|
44
|
+
/**
|
|
45
|
+
* Validates the given content object using the backend service.
|
|
46
|
+
* Logs the process and throws an HTTP exception if validation fails.
|
|
47
|
+
*
|
|
48
|
+
* @param content Content object to validate.
|
|
49
|
+
* @returns Resolves if validation is successful.
|
|
50
|
+
* @throws HttpException if the backend returns an error.
|
|
51
|
+
*/
|
|
52
|
+
validateContent(content: LabContent): Promise<void>;
|
|
53
|
+
/**
|
|
54
|
+
* Submits content for a given resource.
|
|
55
|
+
*
|
|
56
|
+
* @param resourceId Unique identifier of the resource.
|
|
57
|
+
* @param content Content object to submit.
|
|
58
|
+
* @throws HttpException if the backend returns an error.
|
|
59
|
+
*/
|
|
60
|
+
submitContent(resourceId: string, content: LabContent): Promise<void>;
|
|
61
|
+
/**
|
|
62
|
+
* Directly submits content without extra validation.
|
|
63
|
+
* Backend will handle validation internally.
|
|
64
|
+
*
|
|
65
|
+
* @param resourceId Unique identifier of the resource.
|
|
66
|
+
* @param content Content object to submit.
|
|
67
|
+
* @throws HttpException if the backend returns an error.
|
|
68
|
+
*/
|
|
69
|
+
validateAndSubmitContent(resourceId: string, content: LabContent): Promise<void>;
|
|
70
|
+
/**
|
|
71
|
+
* Removes content associated with a given resource.
|
|
72
|
+
* Logs errors but does not throw; always resolves to allow safe cleanup.
|
|
73
|
+
*
|
|
74
|
+
* @param resourceId Unique identifier of the resource.
|
|
75
|
+
*/
|
|
76
|
+
deleteContent(resourceId: string): void;
|
|
77
|
+
/**
|
|
78
|
+
* Retrieves content in a specified format from the backend.
|
|
79
|
+
* Provides default values if content retrieval fails.
|
|
80
|
+
*
|
|
81
|
+
* @param resourceId Unique identifier of the resource.
|
|
82
|
+
* @param type Format of content to retrieve ('json', 'text', 'html', 'populated').
|
|
83
|
+
* @returns Retrieved content in the requested format.
|
|
84
|
+
*/
|
|
85
|
+
getContent<Type extends ContentType>(resourceId: string, type: Type): Promise<ContentTypeReturnTypeMap[Type]>;
|
|
86
|
+
/**
|
|
87
|
+
* Retrieves content from the cache if available; otherwise fetches from the backend.
|
|
88
|
+
*
|
|
89
|
+
* @param resourceId Unique identifier of the resource.
|
|
90
|
+
* @param type Format of content to retrieve.
|
|
91
|
+
* @returns Cached or freshly retrieved content.
|
|
92
|
+
*/
|
|
93
|
+
getCachedContent<Type extends ContentType>(resourceId: string, type: Type): Promise<ContentTypeReturnTypeMap[Type]>;
|
|
94
|
+
}
|